Poker Odds

Every now and then I like to play a game of poker.

Hands, in poker, are ranked according to the basic chances of them occurring. Those hands that would randomly occur with a lower frequency rank higher than those that are more likely to occur. In the most vanilla form of poker, five cards are dealt to make a hand. The hand rankings for five card poker are shown in the table below. ||A standard deck of playing cards contains 52 cards, and these can be arranged to make a total of 2,598,960 distinct sets of five cards.Mathematicians often write this number as 52C5 (spoken as “52 choose 5”). It’s a measure of the ways that five cards can be selected from 52 cards without replacement, and not worrying about their order.|

Mathematicians often write this number as 52C5 (spoken as “52 choose 5”). It’s a measure of the ways that five cards can be selected from 52 cards without replacement, and not worrying about their order.

The calculation of these choices (also called combinations) are the number of ways that k items can be picked from a set of n items in an unordered way. It can be calculated using the following formula:

Five Card Poker

||Hand|FrequencyStraight Flush|40| |Four of a kind|624| |Full House|3,744| |Flush|5,108| |Straight|10,200| |Three of a kind|54,912| |Two pair|123,552| |One pair|1,098,240| |High card|1,302,540| | |TOTAL|2,598,960|

If five cards are dealt, to the left is the table of all the ranks and the frequencies of them occuring. The highest ranked hand is the straight flush. In a straight flush, all cards are of the same suit (flush), and they are numerically connected in order (straight). If there is more than one straight flush, the value of the highest card is compared.

Many poker enthusiasts call out the very highest possible Straight Flush: A-K-Q-J-10 and give it the special name of a Royal Flush, but there is no real reason to do this as it’s simply a higher version of a regular straight flush.

Even though there are 40 possible straight flushes, there are only four possible royal flushes. One for each suit.

It’s a fun exercise to see how we can mathematically derive all the above frequency numbers.


||Straight Flush|

For a straight flush, not only do the cards need to be of the same suit, but they all need to be numerically connected. There is only one of each card of each suit. The highest possible straight flush ends with an Ace. The next highest ends with a King, then a Queen, all the way down to the run ending with a five. In poker the Ace can be used either as a high-card, or a low-card (but not both types in the same hand, so it’s not possible for a straight to roll over the top).

This means there are ten possible straight flushes in any suit: A-K-Q-J-10, K-Q-J-10-9, Q-J-10-9-8 … 5-4-3-2-A

(The lowest straight is also given the vernacular name of a Wheel).

Ten possible straights in each suit, and four suits, results in 40 possible straight flushes out of the 2,598,960 hands.

Another way to calculate this is to say we have 10C1 × 4C1 (Ten possible choices for the first card, and four possible suits).


||Four of a kind|

To get four of a kind we have, as the name implies, four of one kind, then a singleton. As there are only four of any number, this singleton can by any of the other non-used cards.

There are thirteen different cards that can be used for the quads: A,K,Q,J,T … 3,2, this leaves 48 other cards for the singleton. So the number of possible hands is 13 × 48 = 624.

Another way to calculate this is to say we have 13C1 × 48C1 (Thirteen possible choices for the quads card, and forty-eight possible choices for the singleton).


||Full House|

In a full house, there are three of one kind of card, and two of another. There are thirteen possible cards that can be used for the triple, leaving twelve possible (different) cards that can be used for the pair. For the triple, as there are three cards, there are 4C3 different combinations of the cards (An easy way to think of this is that this has to be four: If you are selecting three cards, there are four ways, one for each suit that is missing).

After the triple, there are twelve possible cards that can be selected as the pair.

There 4C2 ways the suits of the twelve possible pairs can be arranged.

So the number of full houses possible is: 13C1 × 4C3 × 12C1 × 4C2 = 13 × 4 × 12 × 6 = 3,744.


||Flush|

This one gets a little more complicated, but there’s a little trick, and we can leverage a previously calculated answer.

For a flush, all the cards are the same suit. Let’s pick the suit first. There are 4C1 choices.

There are 13 cards in a suit, and from these, we need to pick any 5, so this would have been 13C5, however if we do this we’ll be double counting a straight flush (where all the cards are in numeric order). We have, however, already determined there are forty straight flushes, so all we have to do is subtract this number of straight flushes from all the flushes.

Flushes: (4C1 × 13C5) − 40 = (4 × 1,287) - 40 = 5,108.


||Straight|

The calculations for a vanilla straight is a little more complex.

As from above there are ten possible cards that the highest card of the straight can be. This card can be any one of the four possible suits, so as a starting point there are 10 × 4C1 = 40 possible top cards of any straight.

After this card, the numeric value of each subsequent card below is already defined; the only variable is suit, and there are 4C1 ways each next card can be selected. The last step, as above, is to subtract out the number of straight flushes, to stop the double count if all the cards in the straight have the same suit.

Straight: ((10 × 4C1) × 4C1 × 4C1 × 4C1 × 4C1) - 40 = 10 × (4C1)5 - 40 = (10 × 1,024) - 40 = 10,200.


||Three of a kind|

Things are getting a little more complex. For three of a kind, we can have any of the thirteen possible numbers for the triple (just like the start of the full house), but for the two remaining cards, not only do they need to be different from the triple, they need to be different from each other (otherwise they set would be a full house). We don’t care what the suit of these last two cards are, so there are 4C1 ways for each of these singletons.

Three of a kind: 13C1 × 4C3 × 12C2 × (4C1)2 = 13 × 4 × 66 × 16 = 54,912.


||Two Pairs|

For two pairs there are thirteen possible values that each of the pairs could have, and from these we need to select two 13C2. Each of these pairs can be made from two differenent suits 4C2. The singleton can have a value of any of the other unused 11 cards 11C1, and be any one of the suits 4C1

Two Pair: 13C2 × (4C2)2 × 11C1 × 4C1 = 78 × 36 × 11 × 4 = 123,552.


||Pair|

To get a hand with a pair there are thirteen possible values for the paired card 13C1, and this can happen in 4C2 suited ways. The remaining three cards can be any suit, and we need to select this card from the remaining 12, so 12C3 cards each one of them 4C1 suits.

Pair: 13C1 × 4C2 × 12C2 × (4C1)3 = 13 × 6 × 220 × 64 = 1,098,240.


||High Card|

In theory, we don’t need to calculate this value. Paraphrasing Sherlock Holmes; once we’ve eliminated the impossible, whatever left is the solution. We know the total number of possible sets is 2,598,960 and we’ve calculated the occurences of all the other possible hand rankings. If we add up all the other ranking hands and subtract this from the total number, we should be left with the number of hands which have nothing but a high card.

However, since we like the challenge (plus it’s good verify), here’s the calculation.

Because the values of the card have to be distinct (not even a pair), there are 13C5 basic ways these values can be selected. Let’s assume, for now, that each of these cards can be any suit.

We’re almost home. From this value we subtract away the number of straights, flushes, and straight flushes.

High card: 13C5 × (4C1)5 - 40 - 5,108 - 10,200 = (1,287 × 1,024) - 40 - 5,108 - 10,200 = 1,302,540.

Another way to calculate this value is to start with the 13C5 ways to get five values and from that subtract the 10 we know are the only straights. This gives us the values of the cards. Then we need to look at the suits. Each of the cards can be any the suits, with the exception of the four times when the suits all align and it would be a flush.

Alternative High card calculation (13C5 - 10) × ((4C1)5 - 4) = (1,287 - 10) × (1,024 - 4) = 1,302,540.

Thankfully all our possible hand combinations add up to 2,598,960. Phew!

A standard deck of cards has four suits. Because of this, a full house occurs less frequently than a flush, which in-turn occurs less frequently than a straight. What would happen if there were less suits in a deck, or more suits?

This is an interesting thought exercise. If we had a ‘skinny’ deck with just three suits (or maybe even two?), then flushes would become much more common. Taken to the limit, if there was just one suit, then every hand would be a flush!* How would the other probabilities change?

An added complication is that, with more than five suits it is possible to get a new hand type: Five of a Kind!

*Or a straight flush!

Going the other way, what if cards could have more than 13 different values? The higher the number of cards in a deck, the harder it would be to make straights. If we say that Jack=11, Queen=12, and King=13 how would the probabilities change if there were 15 distinct cards for each of the four suits? How about 20?How about if we combined both these and varied both the number of suits and the range of the cards?

How about if we combined both these and varied both the number of suits and the range of the cards?

Leveraging what we’ve learned above it’s possible to derive generic formulae for the number of occurences of each of these hands.

If S is the number of suits in a deck, and V is the range of values, then here are the generic formulae for the number of hands:* |Five of a kind|VC1 × SC5| |Straight Flush|