Brian Alspach
1 August 2003
A class of basic questions in poker involves counting the number of different hands for a variety of games. Much of the complication in answering this kind of question arises because of straights. For example, if we ask how many straights are possible in hold'em, we quickly reach the situation of having to consider sets of ranks that allow straights by adding 2 cards from a player's hand to the 5 on board. Another example would be determining the number of straight flushes possible when a joker is added to a standard 52-card deck.
Such questions require us to know something about sets of ranks allowing straights under different conditions. The purpose of this file is to provide that information as a reference for counting problems.
We first consider rank sets with 3 elements. Of course, such a rank set will not allow a straight unless we add two addtional ranks. That is possible in both hold'em and Omaha, or in a game with 2 or more wild cards. There are rank sets with 3 elements.
A rank set {} that allows a straight upon adding 2 ranks clearly must be a subset of 5 consecutive ranks of the form . By considering the smallest of the 3 ranks, these rank sets become easy to count. Without loss of generality, assume is the smallest of the 3 ranks. Then it is clear that are chosen from { } except for being either a J or a Q.
Thus, for being one of A,2,...,10, there are 6 choices for the other 2 ranks. When is a J, then there are 3 choices for the other 2 ranks. Finally, when is a Q, there is 1 choice for the other 2 ranks. Summing all of these gives us exactly 64 rank sets.
There are 64 rank sets with 3 elements that allow a straight upon adding 2 more ranks. Of these 64 rank sets, 10 allow Broadway, that is, an ace high straight.
A rank set with 4 elements can allow a straight by adding at least 1 rank. We break them down accordingly. There are rank sets with 4 elements.
A rank set { } allows a straight upon the addition of 1 extra rank if and only if the 4 ranks are a subset of 5 consecutive ranks. By considering the smallest element as above, we see that there are 4 choices for the other 3 ranks when the smallest rank is any of A,2,...,10. When the smallest element is J, then there is only 1 choice for the other 3 ranks. Altogether, we obtain 41 rank sets.
There are 41 rank sets with 4 elements that allow a straight upon adding 1 more rank. Of these, 5 allow Broadway.
A rank set with 4 elements that needs 2 additional ranks to make a straight has 3 of its ranks contained in 5 consecutive ranks, but does not have all 4 of its ranks contained in 5 consecutive ranks because then it would require only 1 additional rank to form a straight. We must be careful because the 5 consecutive ranks are not unique. For example, the rank set {2,4,6,8} allows a straight by adding either the ranks 5,7 or 3,5. We avoid duplicate counting by considering the biggest straight a rank set allows when adding 2 ranks.
If the rank set allows Broadway, then it contains precisely 3 ranks from {10,J,Q,K,A}. The remaining ranks are chosen from 2 through 9 giving us 80 rank sets that become Broadway upon adding 2 ranks to the set. However, some of them already have been counted above since they also allow a straight with the addition of a single element. Let's see how many of these we have. None of the 6 choices involving an A can have this property since 2 of the other ranks from 10 through K are missing. Any of the 4 choices of 3 chosen from {10,J,Q,K} containing 9 as the other rank, uses 4 ranks from {9,10,J,Q,K}. Furthermore, if 10,J,Q is chosen, then 8 also produces a straight by adding a single rank. This gives us 5 sets that have appeared above. Therefore, we have 80 sets of 4 ranks that allow Broadway upon adding 2 ranks and do not allow Broadway with the addition of only 1 rank, but 5 of them do allow a straight upon adding a single rank. In other words, we have produced 75 sets not already counted.
If the rank set allows a K-high straight as the biggest straight, then it does not contain A or else it also allows Broadway. On the other hand, it must contain precisely 3 ranks chosen from {9,10,J,Q,K}, but not 3 from {10,J,Q,K} or else it allows Broadway. Thus, the set contains 9 and 2 elements chosen from {10,J,Q,K}. The remaining rank may be any from 2 through 8. This gives us 42 choices. As in the case of Broadway, some of these sets allowing a K-high straight with the addition of 2 ranks, allow a smaller straight with the addition of a single element. The 3 choices involving K cannot have this property since there are 2 ranks between 9 and K missing. However, the choices of Q,J or Q,10 preclude using 8. The choice of J,10 precludes both 7 and 8. Therefore, of the 42 sets allowing a K-high straight with the addition of 2 ranks, 4 of them also allow straights with the addition of a single rank. In other words, 38 of the rank sets are new.
In the preceding two cases of Broadway and K-high straights, we saw that certain choices produce sets allowing straights with the addition of a single element. Starting with the rank of Q, we may have the same kind of behavior because of larger ranks as well. We check Q-high straights separately and then handle the rest with a general argument.
If the rank set allows a Q-high straight as the biggest straight upon adding 2 ranks, then it definitely cannot contain a K. So the rank set has exactly 3 ranks chosen from {8,9,10,J,Q}, but not 3 ranks from {9,10,J,Q}. This means rank 8 must be in the set and we are choosing 2 ranks from {9,10,J,Q}. There are 6 choices of 2 ranks from {9,10,J,Q}, and 3 of them contain a 9 while the other 3 do not contain a 9. The 3 choices not involving a 9 do not allow an A to be the missing rank or else Broadway is possible. So, for 3 of the choices, the missing rank comes from 2 through 7, whereas, for the other 3 choices, the missing rank may be anything from A through 7. Thus, there are 39 rank sets allowing a Q-high straight upon adding 2 ranks.
Again we check to see which of the preceding sets also allow a straight with the addition of a single element. Recall that 8 is in all the rank sets. If 9,10 is chosen, then using either 6 or 7 as the missing rank, produces a set allowing a straight by adding only a single rank. If 9,J is chosen, then 7 for the missing rank is the only choice producing one of the sets counted above. If 9,Q is chosen, there are no choices already used above. If 10,J is chosen, then 7 is the only troublesome rank. If 10,Q or J,Q is chosen, then none of the choices get us in trouble. This means we have produced 35 new sets of 4 ranks for Q-high straights.
The pattern for J-high straights down through 5-high straights is the same and only slightly modified from Q-high straights. Suppose we are looking for rank sets with 4 elements that allow the straight {x,x+1,x+2,x+3,x+4} as the biggest straight upon adding 2 ranks to the set, where x ranges through A,2,...,7. First, the rank x+5 cannot be in the set because if it were and the addition of 2 ranks produced the straight under discussion, then it also would produce an (x+5)-high straight. Thus, our set does not contain x+5, contains 3 elements from {x,x+1,x+2,x+3,x+4}, but does not contain 3 elements from {x+1,x+2,x+3,x+4}. This implies that the set contains x and 2 choices from {x+1,x+2,x+3,x+4}. Of the latter 6 choices, 3 use x+1 and allow us to use x+6 giving us 7 choices for the missing rank. Of the other 3 choices not using x+1, 2 of them use x+2 so that we cannot use x+6 as the missing rank or else a bigger straight is allowed upon adding 2 ranks. Hence, there are 6 choices for the missing rank in this case. The remaining choice is x+3,x+4 which also precludes the use of x+7 as the missing rank. Altogether we have 38 possible rank sets.
We now check to see which of the 38 rank sets also allow a straight upon adding a single element. When x,x+1,x+2 are chosen, then either x-2 or x-1 produce such sets. When x,x+1,x+3 are chosen, then x-1 produces such a set. Finally, when x,x+2,x+3 are chosen, then x-1 produces such a set. Thus, for x = A we have no sets already counted. For x = 2, we have 3 sets already counted. For the other values of x, we have 4 sets already counted.
We now present the information in the next table. The column headed `Straight' tells how high the straight is, the column headed `Adding 2 Ranks' gives the number of rank sets with 4 elements that require 2 ranks to be added in order to have a straight of the particular rank, and the column headed `Adding 1 Rank' tells how many of the rank sets can achieve a straight by adding just 1 rank, but be warned that the straights achieved by adding 1 rank are of lesser rank than the straight achieved by adding 2 ranks.
Straight | Adding 2 Ranks | Adding 1 Rank |
A-high | 80 | 5 |
K-high | 42 | 4 |
Q-high | 39 | 4 |
J-high | 38 | 4 |
10-high | 38 | 4 |
9-high | 38 | 4 |
8-high | 38 | 4 |
7-high | 38 | 4 |
6-high | 38 | 3 |
5-high | 38 | 0 |
There are 283 rank sets with 4 elements that cannot achieve a straight by adding 2 elements.
Since aces play a special role in some of the counting problems, here is some information about sets involving aces. There are 220 sets of 4 ranks containing A as one of the ranks. Of these sets, 92 do not allow a straight upon adding 2 ranks, 120 allow a straight upon adding 2 ranks but do not allow a straight by adding a single rank, and 8 sets allow a straight by adding one rank. Of the latter 8 sets, 4 of them allow a bigger straight by adding 2 ranks.
There are rank sets with 5 elements. It is easy to see that there are exactly 10 rank sets that already correspond to straights. Every one of these sets allows 7 consecutive ranks upon the addition of 2 ranks.
There are 10 rank sets with 5 elements that already correspond to a straight. Every one of them allows 7 consecutive ranks upon adding 2 more ranks. Of these, 3 allow 7 consecutive ranks A-high.
We now count the rank sets with 5 elements that do not correspond to straights, but allow a straight by adding a single rank. We do so by examining the biggest straight the sets allow.
If the rank set allows Broadway upon adding a single rank, then the set must contain 4 elements chosen from {10,J,Q,K,A}. The 5th rank may be freely chosen from 2 through 9. This yields 40 rank sets.
If the rank set allows an (x+4)-high straight as the biggest straight upon adding a single rank, where x is chosen from A,2,...,9, then the element x+5 is not in the set. Thus, we choose 4 elements from the set {x,x+1,x+2,x+3,x+4}, except for the choice x+1,x+2,x+3,x+4 as it allows an (x+5)-high straight. We choose the remaining rank from 7 ranks with 1 exception. If we happen to choose x,x+2,x+3,x+4, then we cannot choose x+6 (recall that x+5 is never in the set). So in this case there are only 6 choices. This does not apply to K-high straights because there is no rank x+2 in that case. For all smaller straights we lose 1 set giving us 27 sets.
Rank | 5 | 6 | 7 | 8 | 9 | 10 | J | Q | K | A |
Number | 27 | 27 | 27 | 27 | 27 | 27 | 27 | 27 | 28 | 40 |
Consecutive | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
In the above table, the label of the column corresponds to the rank of the straight, and the number tells us how many rank sets with 5 elements allow straights, with that rank as the maximum possible rank, upon adding a single rank. The row entitled `Consecutive' tells us how many of the sets allowing an x-high straight upon adding 1 rank consist of, in fact, 5 consecutive ranks. There are 284 rank sets producing straights by adding a single element and 275 of them have not been counted earlier.
We now move to rank sets with 5 elements that achieve an x-high straight upon adding 2 ranks. As in the section on 4 ranks, some of these sets will have been counted already. We must exercise care to detect all of these situations.
Any of the sets achieving Broadway by adding fewer than 2 ranks certainly do the same if we add 2 ranks. Thus, we consider only those sets that actually require 2 ranks to be added. This means that we are choosing precisely 3 ranks from {10,J,Q,K,A} and the other 2 ranks are chosen from 2 through 9. This gives us such sets altogether. We now wish to determine which of them have appeared in the sets already described in this section, that is, those with 5 consecutive ranks or those needing only 1 element to allow a straight.
The sets
Sets of 5 ranks allowing a K-high straight as the biggest straight upon adding 2 ranks, must use precisely 3 elements from {9,10,J,Q,K} and no A. In addition, the set cannot use 3 elements from {10,J,Q,K} or else Broadway may be achieved when adding 2 ranks. Therefore, the set must contain a 9 and 2 elements chosen from 10 through K. The other 2 elements are chosen from 2 through 8. This produces 126 sets that allow a K-high straight upon adding 2 elements, but not allowing a bigger straight.
Now we wish to determine which of these 126 sets have appeared earlier. There are 3 choices of 2 elements from {10,J,Q,K} involving K. The only way the resulting 63 choices can have appeared before is that the set may allow a straight upon adding 1 element. Let's count those that fall into that category. The choice of 9,Q,K doesn't allow a straight to arise by adding 1 rank no matter what the other 2 ranks are. The choice 9,J,K has only the completion 7,8 in that category. The choice 9,10,K has only the completions 6,7 or 6,8 or 7,8. Thus, 59 of the 63 sets are new.
Now move to the 3 choices not involving a K. The choice 9,10,Q has appeared before if we have y,8 where y runs from 2 through 7, or we have 6,7. This gives us only 14 new sets from the 21. The choice 9,J,Q leads to y,8 having appeared before. That produces 15 new sets. Finally, the choice 9,10,J has appeared before for y,8, with y running from 2 through 7, or y,7, where y runs from 2 through 6. This gives just 10 new sets.
Therefore, of the 126 sets that allow a K-high straight as the biggest straight upon adding 2 ranks, 98 are new.
Now let's examine the general case of a set of 5 elements allowing an (x+4)-high straight as the biggest straight upon adding 2 ranks, where x runs through A,2,...,8. We easily can see that the set must contain rank x, precisely 2 elements chosen from {x+1,x+2,x+3,x+4}, and no element of rank x+5. A few more exclusions are required to eliminate bigger straights being allowed. If x+2,x+3 is chosen, then we cannot use rank x+6 so that we are choosing 2 elements from 6 elements giving us 15 sets. If x+2,x+4 is chosen, then we cannot use rank x+6 or the pair x+7,x+8. So we get 14 sets here as long as x+8 makes sense which is the case for 10-high straights and lower. If x+3,x+4 are chosen, then we can use neither x+6 nor x+7. The rank x+7 comes into play for all remaining straights except Q-high. Thus, we obtain 10 sets here since we are choosing the remaining 2 elements from 5 elements. For the 3 choices involving x+1, we are choosing 2 elements from 7 which can be done in 21 ways. However, for x+1,x+4, we cannot use the 3 choices that involve choosing 2 elements from {x+6,x+7,x+8}. This gives us 18 sets in this case. For x+1,x+3, we cannot use x+6,x+7 giving us 20 sets. For x+1,x+2, all 21 choices give us sets that work.
Removing the appropriate number of sets from Q-high down to 6-high, we have 108 Q-high sets, 101 J-high sets, 98 10-high sets, 98 9-high sets, 98 8-high sets, 98 7-high sets and 98 6-high sets. The 5-high sets are an exception because such a set must contain an A meaning that many choices involving 2 ranks from 10,J,Q,K are no longer possible. We do the 5-high sets separately. For A,4,5, we can choose only 9 and one from 10,J,Q,K giving us 4 sets. For A,3,5, we get 8 sets by choosing one of 8 or 9, and one from 10,J,Q,K. For A,3,4, we get 9 sets by using any of the 8 choices for A,3,5 plus the choice 8,9. For A,2,5, we choose any one of 7,8,9 and any one of 10,J,Q,K giving us 12 sets. For A,2,4 we may choose any one of 7,8,9 and any one of 10,J,Q,K, plus the choices 7,9 and 8,9. This produces 14 sets. For A,2,3, we may choose any of those for A,2,4 plus 7,8 giving us 15 sets. Summing yields 62 sets for 5-high straights.
Many of the sets arising in the discussion of the preceding paragraph appear earlier because the sets either consist of 5 consecutive ranks or allow a straight with the addition of 1 rank. We now work out this number for the various values of x. When x,x+3,x+4 are chosen, none of the 10 choices of 2 elements from 5 (or in the case of Q-high from 6 elements) leads to a set that can produce a straight with the addition of 1 element. When x,x+2,x+4 are chosen, the choice of x-2,x-1 produces a set already encountered. This exclusion comes into play only for x with rank 3 or more. When x,x+2,x+3 are chosen, any of the 5 choices involving x-1 give a set already appearing. This comes into play for any x with rank 2 or more. When x,x+1,x+4 are chosen, any of the 3 ways of choosing 2 from {x-3,x-2,x-1} lead to a set already appearing. This affects the collection of sets according to the rank x. When x,x+1,x+3 is chosen, then any of the 6 choices with x-1 lead to a set already appearing. The additional choice of x-3,x-2 also leads to a set already appearing. Finally, when x,x+1,x+2 is chosen, then any of the 6 choices with x-1 and any of the additional 5 choices with x-2 lead to a set already appearing.
As long as x is at least 4, all of the preceding exclusions come into play. There are 27 exclusions altogether so that of the 108 sets for Q-high straights, 81 are new. For the J-high sets, 74 are new. For 10-high, 9-high and 8-high straights, 71 of the 98 sets are new. For 7-high straights, 3 of the exclusions are not in play so that of the 98 sets, 74 are new. For 6-high straights, only 17 of the exclusions are in play, giving us 81 new sets. For 5-high straights, all 62 sets are new.
Straight | Adding 2 Ranks | Adding 1 Rank | Adding 0 Ranks |
A-high | 280 | 39 | 1 |
K-high | 126 | 27 | 1 |
Q-high | 108 | 26 | 1 |
J-high | 101 | 26 | 1 |
10-high | 98 | 26 | 1 |
9-high | 98 | 26 | 1 |
8-high | 98 | 26 | 1 |
7-high | 98 | 23 | 1 |
6-high | 98 | 16 | 1 |
5-high | 62 | 0 | 0 |
The information in the preceding table is to be read as follows. The number in the column headed ``Adding 2 Ranks'' tells us how many rank sets with 5 elements there are that require 2 new ranks to be added in order to achieve a straight whose rank is given in the column headed ``Straight''. From that number of rank sets are some that can achieve a straight by adding only 1 rank even though it produces a straight of smaller rank. That number is displayed in the column headed ``Adding 1 Rank''. The column headed ``Adding 0 Ranks'' tells us how many already are the ranks of a straight. For example, there are 126 rank sets with 5 elements that achieve a K-high straight rank set upon the addition of 2 ranks. Of these 126 rank sets, there are 27 that can achieve a straight by adding only 1 element, and there is 1 rank set being counted that already corresponds to a straight. In this case it is {8,9,10,J,Q}.
One last comment is that there are precisely 79 sets of 5 ranks that cannot achieve a straight by adding 2 ranks.
We now go through the same kind of calculations for rank sets with 6 elements because we shall consider some questions involving a joker. There are sets with 6 ranks.
We first observe the perhaps surprising fact that only 1 of those rank sets does not achieve a rank set allowing a straight upon adding 2 elements. Let's quickly see why this is the case. Suppose we have a rank set of 6 elements including an ace. Then at most 1 of the 5 other ranks can come from {2,3,4,5} and at most 1 from {10,J,Q,K} or else the set allows a straight upon adding 2 ranks. This then forces at least 3 elements to be chosen from {6,7,8,9} and they allow a straight by adding 2 or fewer ranks. Thus, any rank set of 6 elements containing A allows a straight upon adding 2 ranks.
Consider a rank set with 6 elements not containing A. At most 2 elements can be contained in {2,3,4,5,6} and at most 2 elements can be contained in {9,10,J,Q,K} in order to avoid a set that allows a straight upon adding 2 ranks. But this forces 7,8 to be in the rank set and precisely 2 elements from each of the aforementioned subsets. Since 7,8 is in the set, then if any of 4,5,6,9,10, or J is in the set, a straight can be achieved upon adding 2 ranks. Therefore, the set {2,3,7,8,Q,K} is the ONLY rank set with 6 elements that does not lead to a straight upon adding 2 elements.
We are interested in what happens to rank sets with 6 elements upon adding a single rank. There are 9 sets of 6 consecutive ranks. This follows because the smallest rank in the set may be anything from A,2,...,9. Of these 9 sets, 2 contain an A, and 2 become A-high upon adding a joker (1 already is A-high).
Now let's determine the number of rank sets with 6 elements such that 5 are consecutive but without 6 consecutive. For the 5 ranks A,2,3,4,5 and 10,J,Q,K,A, we can add any of 7 other ranks to get a rank set with 6 elements. For 5 ranks of the form x,x+1,x+2,x+3,x+4, where x ranges from 2 through 9, we can add any of 6 ranks. Thus, there are 62 rank sets with 6 elements such that exactly 5 are consecutive. It is not difficult to verify that 20 of them contain an A. Upon adding a joker, 14 give A-high straights. For K-high down through 6-high, there are 6 rank sets for each type of straight.
Next we determine the number of rank sets with 6 elements that do not themselves contain a straight, but the addition of a joker produces 5 or more consecutive ranks. We classify them according to the straight they allow. The 4 ranks J,Q,K,A or 10,Q,K,A or 10,J,K,A produce 28 rank sets each because we can choose any 2 elements from 2 through 9. The 4 ranks 10,J,Q,A produce 27 rank sets because we can choose any 2 elements from 2 through 9 except 8,9 (there are then 5 consecutive ranks in the set). Finally, the 4 ranks 10,J,Q,K produce 21 sets because we can choose any 2 elements from 2 through 8. This gives us 132 rank sets producing Broadway when a joker is added. Note that 111 of the sets contain A.
For K-high straights, the 4 ranks 9,J,Q,K or 9,10,Q,K produce 21 rank sets because we are choosing 2 elements from 2 through 8. For the 4 ranks 9,10,J,K, we get 20 rank sets because the choice 7,8 is not allowed. The 4 ranks 9,10,J,Q give 15 rank sets because we are choosing 2 elements from 2 through 7. This gives us 77 rank sets giving a k-high straight upon adding a joker. None of the sets contains A.
The pattern for K-high straights repeats itself for 5-high straights except that all 77 of the rank sets contain A.
For Q-high straights, 8,10,J,Q and 8,9,10,J produce 15 rank sets. The 4 ranks 8,9,J,Q produce 21 rank sets because we are choosing any 2 elements from A,2 through 7. For 8,9,10,Q, we get only 20 rank sets because 6,7 cannot be chosen. This gives us 71 rank sets of which 17 contain A.
The pattern for Q-high straights repeats itself for 6-high straights, where 17 of the 71 rank sets contain A.
For J-high down through 7-high, we end up with 70 rank sets for each type of straight because 2 of the choices of 4 ranks give us 15 rank sets, and the other 2 choices give us 20 choices because one possible choice is excluded.
Therefore, we have 778 rank sets of 6 ranks without 5 or more consecutive ranks, but producing 5 or more consecutive ranks upon adding a joker. Altogether we have 849 sets of 6 ranks that either have a straight or allow a straight after adding a joker.
We present this information in a table.
Straight | Adding 1 Rank | Adding 0 Ranks |
A-high | 148 | 8 |
K-high | 84 | 7 |
Q-high | 78 | 7 |
J-high | 77 | 7 |
10-high | 77 | 7 |
9-high | 77 | 7 |
8-high | 77 | 7 |
7-high | 77 | 7 |
6-high | 77 | 7 |
5-high | 77 | 7 |
The way to read the preceding table is obvious. An entry in the column headed ``Adding 1 Rank'' tells us how many rank sets with 6 elements there are so that adding a joker makes a straight of the given rank. An entry in the column headed ``Adding 0 Ranks'' tells us how many rank sets with 6 elements there are that already allow a straight of the given rank.
Of the 778 rank sets not already having a straight but allowing a straight after adding a joker, 330 contain A. Thus, of the 849 sets of 6 ranks described in the above table, 352 contain A.
We know there are 867 sets of 6 ranks that do not allow a straight after adding a joker. Since there are sets of 6 ranks containing A, 440 of them are in sets not allowing a straight after adding a joker. Hence, for the 867 sets of 6 ranks not allowing a straight after adding a joker, 440 of them contain A and 427 do not contain A.
We finish by considering those sets that allow 7 consecutive ranks upon adding a single rank. There are 9 choices of sets with 6 consecutive ranks as noted above. Each of these sets certainly allows 7 consecutive ranks by adding a single rank.
To determine the rest, note that 7 consecutive ranks have the form
There are 49 rank sets with 6 elements that allow 7 consecutive ranks upon adding a single rank. Of these, 7 produce A-high with 7 consecutive ranks.