# How many ways can you get a straight or a flush in poker?

Continuing with the work we’ve done in Counting Balls and Counting, Permutations and Combinations we will look at how to count the number of flushes or straight that can be dealt in a poker hand.

## Poker Hands

There are wealth of different types of poker. In each of the cases, we have different number of cards, ways these are dealt, and rules for constructing hands. Additionally, there are different types of card decks that can be used, so we will begin by defining our rules.

For these examples, we will assume that we will be working with a 5 card poker hand where all 5 cards are dealt at once. You can then rearrange these cards as you like in order to make the hand you want. While you would generally have to declare your hand according to your best outcome, we won’t require that you choose one type of outcome. That is, we will count a hand that has four of the same number card as a four of a kind, three of a kind, two pairs and a pair.

Furthermore, we will work with the standard 52 card deck. In this deck, we will have 4 suits; hearts, diamonds, clubs and spades. Each of these suits will have 13 distinct numbered cards; ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, jack, queen, king. When ordering, the cards follow the above ordering with the exception that the ace can also be used as the card following the king.

In general, two pokers hands will be considered the same if the same 5 cards are in the hand, in any order. You cannot have 2 of the same card, because each card appears 1 in the deck. Furthermore, in order to define a hand, we would have to define both the suit and the number for each card. Therefore, if we wanted to count all possible poker hands, we would note that when choosing a hand, repetition of results is not allowed and order does not matter. We saw in the previous posts that this will mean that we are finding the number of combinations of 52 cards, 5 at a time, so there will be $$\binom{52}{5} \approx 2.6$$ million different hands.

### Flushes

A flush in poker is when all 5 cards in your hand are from the same suit. If we want to count the number of ways that we can get a flush, we want to determine the number of ways that we can have distinct hands that result in a flush. In order to do this, we will construct a hand, determining all of the options that are available to us.

In order to construct a flush, the first choice we will have is to choose a suit. Since there are 4 suits in our card deck, there will be four ways we can choose a suit. Once we have chosen a suit, all cards must be this suit. After this, we will need to choose the number for each of the cards. Since there are 13 numbers available and we need 5 of them, we will be picking 5 from 13. Since the order in which we choose them doesn’t matter, there will be exactly $$\binom{13}{5}$$ ways to do this.

Combining this information, we find that the total number of flushes will be $$4 * \binom{13}{5} =5148$$.

### Straights

A straight in poker is when all 5 cards can be arranged so that the numbers of the cards are consecutive. For example, the hand consisting of $$5 \heartsuit, 2 \clubsuit, 6 \spadesuit, 3 \clubsuit, 4 \heartsuit$$ would be a straight because we can rearrange the cards to read $$2,3,4,5,6$$. We will again find all the ways we can construct such a hand.

We begin by choosing the suit of each card. Since a straight is not dependent on the suit of the cards, we can choose any suit we like for each card. We note here that we can also choose the same suit for all the cards since we would count this as straight as well as a flush. Therefore, we have 4 choices for each card. Since there are 5 cards, we have a total of $$4^{5}=1024$$ choices for suit.

Now that we have chosen the suits of the cards, we now have to choose the number for each card. In this case, we note that once we have chosen the lowest numbered card, the remaining cards must follow consecutively from the previous card. Now, note that we can have a straight starting with ace through 10. However, if it starts at a Jack, we will run out of cards to place in our straight, so there are only 10 options for the lowest card.

If we combine this together, we note that we have $$1024$$ choices for suit and 10 choices for numbers of cards. We, therefore, have a total of 10240 ways to construct a straight.

### Straights or Flushes

As we count the number of hands that are a straight or a flush, we will do so by noticing that we can do so by adding the number of straights to the number of flushes and subtracting the number of hands that are both. Note we have to subtract off the hands that are both because we are counting them twice by adding the number of straights to number of flushes.

We will therefore first need to find the number of hands that are both flushes and straight. Such hands would be called a straight flush and would be a hand in which you can rearrange the numbers so that they are consecutive and all the cards will be the same suit. If we follow the process we had above for choosing number and suit, we can find the number of such hands. Since this hand will be a flush, we will have exactly 4 choices for suits. Also, since the hand is a straight, we will have 10 choices for the number. We, therefore, get that there are 40 total straight flushes.

Combining all this, we find that the total number of hands that are a straight or a flush would be $$5148+10240-40=15,348$$.

## Conclusion

We were able to count the number of different ways to get a flush or straight in poker by combining our different counting techniques. We could use these same counting techniques, with some modification in order to count the other types of hands as well. As we do so, make sure to determine how to construct each handing, noting whether or not order matter in each case.

I hope you enjoyed and learned something from this post. If you did, make sure to like it and share it on Social Media with anyone else that may find it useful.

This site uses Akismet to reduce spam. Learn how your comment data is processed.