Cards and hands¶
Counting and combinations · level 5, lesson 6 of 6
A question to start¶
Deal 5 cards from a shuffled pack of 52. How many different hands could you get?
The answer is 2 598 960, about two and a half million. Card players know that "four of a kind" (four cards of the same rank, like four queens) beats a "full house" (three of one rank and two of another). That is because four of a kind is rarer: there are only 624 such hands, against 3744 full houses. In this lesson you will count both, and then every other kind of hand, and see all the counts add up to exactly 2 598 960.
The idea¶
The pack¶
An ordinary pack has 52 cards. Each card has a rank and a suit:
- 13 ranks: A (ace), 2, 3, 4, 5, 6, 7, 8, 9, 10, J (jack), Q (queen), K (king);
- 4 suits: clubs, diamonds, hearts, spades.
Every rank comes once in every suit, so \(13 \times 4 = 52\) cards. It helps to picture the pack as a grid:
A hand is a combination¶
A hand is the set of cards you hold. Being dealt the king of hearts first and the 7 of clubs second gives the same hand as the other way round. So a 5-card hand is a combination:
The top, \(311\,875\,200\), counts the ways to deal 5 cards in order. Each hand can be dealt in \(5! = 120\) orders, which is why we divide.
The method: ranks first, then suits¶
Counting a type of hand directly from 52 cards is confusing. A clear method is to make a list of decisions:
- Decide which ranks appear and what role each one plays (the rank of the three, the rank of the pair, and so on).
- For each rank, decide which suits it comes in.
- Multiply the decisions together.
The one thing to be careful about is in step 1. If two ranks play different roles (like "the three" and "the pair" in a full house), then choosing kings-for-the-three and sevens-for-the-pair is different from sevens-for-the-three and kings-for-the-pair, so pick them one after the other, in order. If two ranks play the same role (like the two pairs in "two pair"), then swapping them gives the same hand, so use a combination.
Four of a kind¶
Four cards of one rank, plus one other card.
- The rank of the four: 13 ways.
- All four suits of that rank are used: \(\dbinom{4}{4} = 1\) way.
- The fifth card can be any of the other \(52 - 4 = 48\) cards.
Total: \(13 \times 1 \times 48 = 624\).
Full house¶
Three cards of one rank and two of another, like K K K 7 7 in the picture.
- The rank of the three: 13 ways. The rank of the pair: 12 ways (it must be different). These roles are different, so it is \(13 \times 12\), not \(\dbinom{13}{2}\).
- Suits for the three: \(\dbinom{4}{3} = 4\). Suits for the pair: \(\dbinom{4}{2} = 6\).
Total: \(13 \times 12 \times 4 \times 6 = 3744\).
So there are 6 times as many full houses as hands with four of a kind, which is why four of a kind ranks higher.
All the hands¶
Using the same method for every type of hand gives this table. A straight is five ranks in a row (the ace can be low, A 2 3 4 5, or high, 10 J Q K A, which gives 10 possible runs). A flush is five cards of one suit. A straight flush is both. Each line counts only hands that are not in a line above it.
| Hand | How to count it | Number |
|---|---|---|
| straight flush | 10 runs × 4 suits | 40 |
| four of a kind | \(13 \times 48\) | 624 |
| full house | \(13 \times 12 \times \binom{4}{3} \times \binom{4}{2}\) | 3 744 |
| flush (not straight) | \(4 \times \binom{13}{5} - 40\) | 5 108 |
| straight (not flush) | \(10 \times 4^5 - 40\) | 10 200 |
| three of a kind | \(13 \times \binom{4}{3} \times \binom{12}{2} \times 4^2\) | 54 912 |
| two pair | \(\binom{13}{2} \times \binom{4}{2}^2 \times 44\) | 123 552 |
| one pair | \(13 \times \binom{4}{2} \times \binom{12}{3} \times 4^3\) | 1 098 240 |
| nothing | everything else | 1 302 540 |
| total | \(\binom{52}{5}\) | 2 598 960 |
The last line is a strong check. The "nothing" hands can also be counted directly: 5 different ranks that are not a run, \(\dbinom{13}{5} - 10 = 1277\) ways, times suits that are not all the same, \(4^5 - 4 = 1020\) ways, giving \(1277 \times 1020 = 1\,302\,540\). ✓ Everything fits together.
From counts to chances¶
When every hand is equally likely, the chance of a type of hand is its count divided by the total. A full house comes up about once in every \(2\,598\,960 \div 3744 \approx 694\) hands; four of a kind about once in every 4165 hands; a pair about 42 times in every 100 hands. This is where counting hands over to Probability.
Worked examples¶
1. Three of a kind. Three cards of one rank and two other cards of two different other ranks (otherwise it would be a full house or four of a kind).
- Rank of the three: 13. Its suits: \(\dbinom{4}{3} = 4\).
- The two other ranks play the same role (two odd cards), so choose them together: \(\dbinom{12}{2} = 66\).
- A suit for each of those two cards: \(4 \times 4 = 16\).
- Total: \(13 \times 4 \times 66 \times 16 = 54\,912\).
2. Two pair. Like Q Q 5 5 9.
- The two ranks for the pairs play the same role (swapping them gives the same hand): \(\dbinom{13}{2} = 78\).
- Suits for each pair: \(\dbinom{4}{2} \times \dbinom{4}{2} = 36\).
- The fifth card must not match either pair's rank: \(52 - 8 = 44\) cards.
- Total: \(78 \times 36 \times 44 = 123\,552\).
- If you had used \(13 \times 12\) for the ranks, you would get twice this: Q Q 5 5 9 would be counted as "queens then fives" and again as "fives then queens".
3. Exactly two aces. How many 5-card hands contain exactly two aces?
- Choose 2 of the 4 aces: \(\dbinom{4}{2} = 6\).
- Choose the other 3 cards from the 48 non-aces: \(\dbinom{48}{3} = \dfrac{48 \times 47 \times 46}{6} = 17\,296\).
- Total: \(6 \times 17\,296 = 103\,776\).
4. At least one ace. Count the opposite: hands with no ace at all come from the 48 non-aces, \(\dbinom{48}{5} = 1\,712\,304\). So hands with at least one ace number \(2\,598\,960 - 1\,712\,304 = 886\,656\).
Try it¶
- How many 2-card hands can be dealt from a 52-card pack? How many of them are a pair of aces?
- How many 5-card hands are all hearts?
- How many 5-card hands are a flush of any suit, counting straight flushes too?
- Count the one-pair hands yourself and check the table: one rank appears twice, and three other different ranks appear once each.
- How many 5-card hands contain no picture cards (J, Q or K)?
- How many 5-card hands contain all four suits?
- In the game of bridge each player gets 13 cards. How many different bridge hands are there? (Use a calculator; the answer has 12 digits.)
- A student counts full houses as \(\dbinom{13}{2} \times \dbinom{4}{3} \times \dbinom{4}{2}\). Explain the mistake and by what factor the answer is too small.
Answers
- \(\dbinom{52}{2} = \dfrac{52 \times 51}{2} = 1326\). Pairs of aces: \(\dbinom{4}{2} = 6\).
- Choose 5 of the 13 hearts: \(\dbinom{13}{5} = \dfrac{13 \times 12 \times 11 \times 10 \times 9}{120} = 1287\).
- \(4 \times 1287 = 5148\). (Take away the 40 straight flushes to get the 5108 in the table.)
- Rank of the pair 13, its suits \(\dbinom{4}{2} = 6\); the three single ranks \(\dbinom{12}{3} = 220\) (same role, so a combination); a suit for each, \(4^3 = 64\). Total \(13 \times 6 \times 220 \times 64 = 1\,098\,240\). ✓
- There are 12 picture cards, so 40 others: \(\dbinom{40}{5} = \dfrac{40 \times 39 \times 38 \times 37 \times 36}{120} = 658\,008\).
- Five cards in four suits: one suit has 2 cards, the others 1 each. Choose the doubled suit (4), its two cards \(\dbinom{13}{2} = 78\), and one card from each other suit, \(13^3 = 2197\). Total \(4 \times 78 \times 2197 = 685\,464\).
- \(\dbinom{52}{13} = 635\,013\,559\,600\), about 635 thousand million.
- In a full house the two ranks play different roles (three of one, two of the other), so KKK77 and 777KK are different hands. \(\dbinom{13}{2}\) treats them as the same. The answer \(78 \times 4 \times 6 = 1872\) is too small by a factor of 2; the right count is \(13 \times 12 \times 4 \times 6 = 3744\).
Common mistake¶
Using a combination for ranks that play different roles (or a permutation for ranks that play the same role). Ask the swap question for the ranks: if I swap the rank of the three with the rank of the pair, do I get a different hand? Yes (KKK77 is not 777KK), so choose them in order. If I swap the ranks of the two pairs in two pair, do I get a different hand? No, so choose them together.
Forgetting to keep the extra card from matching. In "four of a kind" the fifth card is any of 48, but in "two pair" the fifth card must avoid both pair ranks (44 cards), and in "three of a kind" the two odd cards must be of different ranks from each other and from the three. Otherwise you count full houses as three of a kind.
Where it leads¶
- Back: Committees with conditions · Next level: Level 6: counting with overlaps and stars
- Level 5 page · Counting topic page
- Shuffling a whole pack, \(52!\) orders, is in Level 4.
- Turning these counts into chances, and lotteries, is in Level 6, counting outcomes for probability and in Probability.
- The "nothing" hands were counted by taking away the hands we did not want; with several overlapping conditions you need inclusion-exclusion.