Chapter 9
Poker

Poker is a very popular type of card game played not only in casinos but also among friends. One of its variants, called Texas Hold'em, has become particularly popular since sports channels such as ESPN started showcasing championships.

Poker is different from the other games we have discussed so far in that the players compete against each other rather than against the casino. Therefore, even though poker has features that are akin to other random games, it is also a game of strategy. In this section, we will discuss the random aspects of the game and will delay the discussion of its strategic aspects until Chapter 11.

9.1 Basic Rules

Just like blackjack, poker is played using a French-style 52-card deck (recall Figure 8.1). Each player is dealt a certain number of cards either face down or face up. In addition, some community cards (which are shared by all players) might be dealt. The winner of each game is the person with the highest five-card hand; the way in which the hand is constructed using the player's and community cards depends on the variant of the game being played (more on this later).

Hands are ranked primarily by their type (see Table 9.1 and Figure 9.1). Card numbers are used only to differentiate among hands of the same type. For this purpose, the cards are ordered 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A. Suits by themselves do not typically play a role in defining the value of a hand, except for helping determine if you have a flush. To understand how hands are compared, let's consider a few examples.

Table 9.1 List of poker hands

Rank Name Description
1 Royal flush The hand contains the A, K, Q, J and 10 of the same suit.
2 Straight flush The hand contains five cards of the same suit with consecutive values. A can come before a 2, but not after K (as the hand would be a Royal Flush).
3 Four of a kind (poker) The hand contains four cards of the same number (one for each suit).
4 Full house The hand contains three cards of one number and two cards of a different number.
5 Flush The hand contains five cards of the same suit, but not a Straight flush.
6 Straight The hand contains five cards with consecutive number values that are not a Straight flush.
7 Three of a kind The hand contains three cards of the same number and is not a full house or a poker.
8 Two pairs The hand contains two pairs, each of a different number.
9 One pair The hand contains two cards of the same number and is not a full house or a poker.
10 Highest card The hand is not any of the above.
Illustration of poker hand rankings.

Figure 9.1 Examples of poker hands.

  1. 1. Assume your hand is c09-math-001 and your opponent's hand is c09-math-002. You have one pair of 2s, while your opponent has an Ace high card. You win the game because a pair beats a single higher card.
  2. 2. Assume now that your hand is c09-math-003, while your opponent's hand is c09-math-004. Both of you have full houses, so we need to look at the number associated with the cards in order to compare hands. We first compare the numbers associated with the three of a kind. Since you have Qs and your opponent has 3s, you win the hand.
  3. 3. Finally, assume that your hand is c09-math-005 and your opponent's hand is c09-math-006. Both of you have (Royal) Straight flushes, so the hand is a tie and the pot is split among the players.

In poker, betting rounds are usually interspaced between rounds of dealing cards (the specific details depend, again, on the variant you are playing). During these betting rounds, players take turns deciding whether to withdraw from the game (fold), increase their bets (raise), or match a raise by another player (call).

9.2 Variants of Poker

There is a large number of variants of poker, which differ mainly on how the player's hands are formed. Three of them are particularly popular nowadays.

In draw poker, a complete hand is dealt to each player, face down and, after betting, players are allowed to improve their hand by discarding unwanted cards and being dealt new ones. After the card exchange, a second round of betting ensues. Five-card draw is the most popular version of draw poker.

In stud poker, cards are dealt in a prearranged combination of face-down and face-up rounds, or streets, with a round of betting following each dealing. The most popular stud variant today, seven-card stud, deals seven cards to each player (three face down, four face up) from which they must make the best possible five-card hand.

Community card poker is similar to stud poker in that cards are dealt to the players in a combination of face-down and face-up cards. However, in community card poker, the face-up cards are shared by all the players. Players are dealt an incomplete hand of face-down cards, and then a number of face-up community cards are dealt to the center of the table, each of which can be used by one or more of the players to make a five-card hand. Texas Hold'em is the best-known community card poker. In Texas Hold'em, each player receives two face-down cards. In addition, five face-up community cards are shared by all players. These cards are dealt in the following order:

  1. 1. First, the two face-down cards are dealt to each player, followed by a round of betting.
  2. 2. The first three community cards are revealed (the flop), followed by a second round of betting.
  3. 3. The fourth community card is revealed (the turn), followed by a third round of betting.
  4. 4. The final community card is revealed (the river), followed by a fourth and last round of betting.

9.3 Additional Rules

In addition to the voluntary bets made by each player during the game, forced bets are often employed to create incentives for the players to wager even when hands are bad. Blinds are a forced bet placed by one or more players that is made before the cards are dealt; these are used very often in draw and community poker. The bring-in is another forced bet that occurs after the cards are initially dealt, but before any other action is taken. Bring-ins are common in stud poker, and it is required from the player with the worst set of open cards.

All in bets are another special type of wager. If you are faced with a bet you cannot match for the lack of sufficient funds, you may bet the remainder of your stack and declare yourself all in. You may now hold onto your cards for the remainder of the round as if you had called every bet, but you may not win any more money from any player above the amount of your stack.

9.4 Probabilities of Hands in Draw Poker

It is particularly easy to compute the probabilities of different hands in draw poker because players have no information about other players' cards. We start by computing the probabilities of getting the different types of hands with the first five cards. To compute these probabilities, recall that a hand of poker consists of five cards drawn randomly without replacement from a single, well-shuffled deck of 52 cards. Therefore, all cards have the same probability of appearing in your hand, cards cannot repeat themselves (you can get two Qs, like c09-math-007 and c09-math-008, but your hand cannot have two c09-math-009), and the order in which the cards are arranged is irrelevant. This implies that we are dealing with an equiprobable space where

equation

Because we are drawing cards without replacement and order does not matter, the total number of possible hands of poker is

equation

(Recall Chapter 4.)

Now we only need to compute the number of hands that correspond to each one of the named hands mentioned in Table 9.1. For the Royal flush and Straight flush, note that for each of the four suits there are 10 different possible five-card sequences:

A,2,3,4,5 2,3,4,5,6 3,4,5,6,7 4,5,6,7,8 5,6,7,8,9
6,7,8,9,10 7,8,9,10,J 8,9,10,J,Q 9,10,J,Q,K 10,J,Q,K,A

The very last one corresponds to a Royal flush, while the other nine are regular Straight flushes. Since there are four suits in the deck, which means that there are four combinations of cards that yield a Royal flush and 36 that yield a Straight flush. Therefore,

equation

For four of a kind, we can split the problem into two parts: first, we figure out how many sets of four cards with the same number can come up, and then we figure out how many options are available for the fifth card in the hand. Since there are 13 possible numbers, the number of possible sets of four cards is very easy: there are 13 of them. On the other hand, the fifth card could be any of the 48 cards left in the deck. Therefore,

equation

Let's look now at the probability of a full house. As before, we break the problem into two parts; we first compute the number of possible trios that can come up, and then we compute the number of pairs. For the number of trios, we have 13 possible options for the number associated with the trio, and we have c09-math-010 options for the combination of suits associated with these three cards (remember that you have four cards with each number, one for each suit, and we need to pick three of them). Therefore, the number of trios is c09-math-011. A similar reasoning can be used for the number of pairs; there are now 12 possible numbers that you could use for the pair (the pair has to have a number that is different from the trio, leaving you 12 rather than 13 options), and there are c09-math-012 combinations of suits for that number, for a total of c09-math-013 distinct pairs. Therefore,

equation

Next we consider the probability of a flush, which is composed of five cards of the same suit. Since there are four possible suits and, for a given suit, there are c09-math-014 sets of five cards (recall that each suit has 13 different cards), there are c09-math-015 such hands. However, this includes the Straight flushes, which should not be included in the count and need to be subtracted (recall that there are 10 Straight flushes for each suit, including Royal flushes). Therefore, the probability of a flush is

equation

The reasoning for a straight is very similar to that for the flush. Recall that there are 10 different straight sequences:

A,2,3,4,5 2,3,4,5,6 3,4,5,6,7 4,5,6,7,8 5,6,7,8,9
6,7,8,9,10 7,8,9,10,J 8,9,10,J,Q 9,10,J,Q,K 10,J,Q,K,A

In principle, there are four options for the suit of the first card, four options for the suit of the second, and so on. Consequently, there are c09-math-016 combinations of suits for each of the 10 straight sequences. However, this number again includes the Straight flushes, so we need to subtract them. Therefore,

equation

For the probability of three of a kind, note that, as with the full house, there are 13 options for the number and c09-math-017 choices for the suits of these three cards. For the fourth and fifth cards of the hand, they might be of any suit, but their numbers need to be different from each other, and different from the number used for the trio (otherwise, you would have a full house or four of a kind). Accordingly, there are c09-math-018 options for the suits of the remaining two cards and c09-math-019 choices for their numbers, leading to:

equation

For two pairs the calculation is very similar. First, we need to pick two numbers out of 13 possible options (remember that the numbers in both pairs need to be from different suits or you have four of a kind), which yields c09-math-020 options. Then, we need to choose the suits for each of the pairs (there are c09-math-021 options for the suits). Finally, we need to look at the fifth card, which can be any card out of the remaining 44 (you need to exclude the eight cards that correspond to any of the numbers in the pairs, or you would have a full house instead of two pairs). Therefore,

equation

Finally, the probability of a single pair is

equation

This results from realizing that there are 13 options for the number of the pair, c09-math-022 options for the suits of the two cards in the pair, c09-math-023 options for the suit of the remaining three remaining cards, and c09-math-024 options for the number of the three remaining cards.

The calculations we just discussed can be easily corroborated using simulations. For example, the probability of three of a kind can be approximated as

c09uf001

Similarly, for the probability of two pairs,

c09uf002

9.4.1 The Effect of Card Substitutions

We consider now how the probabilities of the different hands are affected when you are allowed to replace some cards in your hand. For example, consider the probability of getting a Straight flush if you are allowed to exchange up to one card. In this case, we can reformulate the problem as the probability of getting a Straight flush if you are dealt six rather than five cards from the deck. Indeed, the extra card might or might not be actually drawn depending on whether you get the Straight flush in the first hand, but the calculation is unaffected since you only exchange cards if you need to.

In this case, the total number of possible hands is c09-math-025. To compute the number of hands consistent with the desired outcome, note that five of the cards need to correspond to the desired outcome (a Straight flush) therefore, as before, there are 36 possible options for the first five cards. On the other hand, the sixth card could potentially be any other card in the deck (so there are 47 options left). Hence,

equation

Hence, by allowing the player to exchange one card, the probability of a Straight flush, although still small, is six times higher than before!

9.5 Probabilities of Hands in Texas Hold'em

Texas Hold'em is nowadays the most widely played variant of poker. The use of multiple community cards offers more opportunities to bet than draw poker (allowing for more strategic play) and makes the game less predictable. Indeed, as the flop, turn, and river are revealed, the probabilities that each player wins can change dramatically. In televised games, this is exploited for dramatic effect by showing the cards held by the players along with the community cards and the changing probabilities that each of the player wins.

Recall that, in Texas Hold'em, the player is first dealt two face-down cards (sometimes called hole or pocket cards), followed by a first round of betting. The number of possible pocket hands is relatively small,

equation

which is the number of ways in which a pair of cards can be drawn from a deck of 52 cards without replacement, and the order of the two cards is not important. Computing the probability of the different pocket hands is Straight forward. For example, we can compute the probability of getting a pocket pair (i.e., the probability that the two pocket cards form a pair) as

equation

where the numerator comes from the fact that we have 13 different options for the number of the pair, and c09-math-026 possible combinations of suits for the pair.

Computing the probability of winning a hand in Texas Hold'em requires that we condition on the community cards that have been revealed. For example, assume that your hand is c09-math-027 and the face-up cards are c09-math-028. In that case you have two pairs, one of which is shared by all players (the pair of 8s). The winning hands for an opponent (let's call him Malik) are shown in Table 9.2. We now proceed to compute the probabilities associated with each of these hands.

Table 9.2 List of opponent's poker hands that can beat our two-pair

Opponent's winning hand Opponent's hidden cards Probability
Two pairs Two Qs and two 8s Q & any except 2s, 8s, Qs, or Ks c09-math-029
Two Ks and two 8s K & any except 2s, 8s, Qs, or Ks c09-math-030
Two As and two 8s A & A c09-math-031
Two Qs and two Ks Q & K c09-math-032
Two Qs and two 2s Q & 2 c09-math-033
Two Ks and two 2s K & 2 c09-math-034
Three of a kind Three 8s 8 & any except 2s, 8s, Qs, or Ks c09-math-035
Full house Three 2s and two 8s 2 & 2 c09-math-036
Three Ks and two 8s K & K c09-math-037
Three Qs and two 8s Q & Q c09-math-038
Three 8s and two 2s 8 & 2 c09-math-039
Three 8s and two Ks 8 & K c09-math-040
Three 8s and two Qs 8 & Q c09-math-041
Four of a kind Four 8s 8 & 8 c09-math-042

If Malik has two Qs and two 8s, he will beat your two Js and two 8s. Malik can have this hand if he holds a Q and any other card (excluding 2s, 8s, Qs, or Ks because these would form a three of kind or a full house, which will be considered later). Hence,

equation

Now the probability that Malik gets a Q and any other card in his hand is

equation

The calculation for c09-math-043 is identical. Therefore,

equation

A second way in which you can lose is if Malik has two Ks and two 8s. This can happen if he holds a K and any other card (except 2s, 8s, Qs, or Ks, which would produce a stronger hand than two pair and will be considered below). This calculation goes exactly like the calculation for the previous situation. The probability is therefore c09-math-044.

Another possibility is for Malik to have two As and two 8s. This hand can arise if he holds two As in his hand. The probability of this occurring is

equation

Your opponent's two pairs that beat your two pairs are two Qs and two Ks, two Qs and two 2s, and finally two Ks and two 2s. Each of those situations can be realized if Malik holds a Q and a K, a Q and a 2, or a K and a 2, respectively. The probabilities for these three options are calculated the same way, so we focus on the probability of Malik holding a Q and a K:

equation

Malik can also beat you with three of a kind. This can only happen if Malik holds an 8 and any other card (except the usual 2s, 8s, Qs, or Ks) in his hand. Indeed, notice that if Malik holds two 2s, it will produce not a trio but a full house if you consider the two 8s in the community cards. For the same reason, if Malik holds two Qs or two Ks, they will not count as three of a kind, but as full houses. The probability of three of a kind is therefore,

equation

We now consider the next stronger hand, a full house. This can be realized in six different ways:

  1. 1. Malik holds two 2s, forming a set of three 2s and two 8s.
  2. 2. Malik holds two Ks, resulting in a set of three Ks and two 8s.
  3. 3. He can hold two Qs, forming a set of three Qs and two 8s.
  4. 4. If he holds an 8 and a 2, his hand would be three 8s and two 2s.
  5. 5. He can also hold an 8 and a K, resulting in three 8s and two Ks.
  6. 6. Finally, if Malik holds an 8 and a Q, he will have three 8s and two Qs.

The probability for the first, second, and third possibilities are calculated in the same way. For example,

equation

On the other hand, the probability of holding an 8 and a 2 is

equation

which goes exactly the same way for the probability of obtaining a Q and a 8.

There is just one more way Malik can beat your two pairs; if he has two 8s in his hands, he will be able to form a poker. The probability of this happening is

equation

Once all the cases have been considered, the probability that you lose can be calculated as the sum of all the probabilities in the last column of Table 9.2:

equation

and the probability of a tie is the probability that Malik has the two Js left in the deck, that is,

equation

Given that your probability of winning is relatively large (around 66%), you would probably do well to raise in the last round of betting!

9.6 Exercises

  1. 1. In traditional draw poker (where you are given five cards that are unknown to your opponents), what is the probability that you will be dealt four of a kind in the first hand? If you were allowed to change one card, what would be the probability?

  2. 2. What is the probability that you will be dealt a flush in the first hand in traditional draw poker? If you were allowed to change one card, what would be the probability?

  3. 3. Considering your calculations in the previous two questions, is it beneficial to the player to be allowed to swap cards?

  4. 4. In traditional draw poker, if we are allowed to exchange one card and the current hand is c09-math-045, what is the probability that get a pair if you switch only one card? What is the probability if you decide to exchange four cards and only keep the highest card in your hand (the c09-math-046)?

  5. 5. You are playing five-card stud poker without bring-in and only one opponent is left. You show c09-math-047 and your hidden card is c09-math-048. Your opponent's open hand is c09-math-049. What is the probability that you will win the game? How would it change if your hidden card is c09-math-050?

  6. 6. You are playing five-card stud poker without bring-in and only one opponent is left. You show c09-math-051 and your hidden card is c09-math-052. Your opponent's open hand is c09-math-053. What is the probability that you will win the game?

  7. 7. In a Texas Hold'em game with only two players, your hand is c09-math-054, your opponent's hand is c09-math-055 and the hand shown on the table before the river is c09-math-056. What is the probability that you win the hand once the river is turned? What is the probability that you will tie?

  8. 8. What would be the answer to the previous problem if you only knew one of your opponent's cards; in particular, what would it be if you only knew that his hand includes c09-math-057? Note: This can be a bit laborious.

  9. 9. In a Texas Hold'em game with only two players, your hand is c09-math-058, your opponent's hand is c09-math-059 and the hand shown on the table before the river is c09-math-060. What is the probability that you win the hand? What is the probability that you will tie?

  10. 10. In a Texas Hold'em game with only two players, your hand is c09-math-061, your opponent's hand is c09-math-062 and the hand shown on the table before the river is c09-math-063. What is the probability that you win the hand? What is the probability that you will tie?

  11. 11. In a Texas Hold'em game with only two players, your hand is c09-math-064, your opponent's hand is c09-math-065 and the hand shown on the table before the river is c09-math-066. What is the probability that you win the hand? What is the probability that you will tie?

  12. 12. In a Texas Hold'em game with only two players, your hand is c09-math-067, your opponent's hand is unknown and the hand shown on the table c09-math-068. What is the probability that you win the hand? This will be a long calculation; it will be very good if you can start by outlining your solution and then add details as much as possible.

  13. 13. [R] Build a simulation to corroborate the calculation of the probability of a flush. How large do you need to make your simulation if you want to get accurate estimates of this probability?

  14. 14. [R] The strategy for hand substitutions in draw poker is not always obvious. A common conundrum is the following: Assume that your hand consists of a pair of 2, an A, and two more cards that are not 2, A, or form a pair. Should you keep the pair of 2 and swap three cards, or should you keep the A and swap four cards? Write a simulation in R that can help you decide which option leads to a higher hand.

  15. 15. [R] Construct a simulation to estimate the probability that you win a game of Hold'em if you hold c09-math-069 and the five community cards are c09-math-070.