The Maths of Poker

Sian Langham

Why do we study Maths? A question I’m sure most of us have asked ourselves at some point – maybe it was when studying long division in school or when trying to help your child with their maths homework for the umpteenth time… What’s the purpose of it all? Well, let’s start simple. We need to use arithmetic when adding up the cost of our groceries in a supermarket, or percentages when working out the sale price of a discounted shirt. Delving a little deeper you will in fact discover that maths can be found in the most unexpected places, and in this series of articles I plan to explore some of these in detail to give you the perfect answer next time someone asks “why do we study maths?”.

Article 1: Binary Code and Storing Music on Computers

Article 2: Golf and Projectile Motion

Article 3: Catching Fraudsters with Maths

Our final application of maths relates to a rather famous card game…

Simply put, the game of poker is full of maths. The higher the level you play at, the more maths you need to consider to find a winning strategy – it’s not just about luck. Experienced players will know all about pot odds, expected values and game theory, and perhaps most importantly, how to use them effectively to win a game of poker.

Game theory is the science of strategy. It tries to determine using maths and logic what moves or decisions a person should make in order for them to secure the best outcome for themselves in a given situation. Although it’s called game theory, it isn’t just applied to parlour games such as chess, poker and rock paper scissors. There are many examples when it can be applied to real life situations, for example the way animals behave in order to survive and finding the optimum price to sell items in a shop. However, one thing that all the games have in common is that they are all interdependent. This means that the decisions of one person in the game not only affects them, but all the other players. For example, if there are a group of people at a car auction, and one person makes a bid of £3,000, it affects everyone else at the auction because they now have to make a bid over £3,000 in order to win the auction.

Let’s look at a common example that is found in everyday life: the volunteers dilemma. It models a situation where each person can make a sacrifice in order to benefit themselves and everybody else, or sit back and wait for somebody else to make that sacrifice. It is found that the more observers there are, the less likely someone is to come forward. Let’s suppose someone is injured and there are two bystanders that could help. As they both know one of them has to help, they are more likely to aid the casualty than if there was a crowd of fifty people because there are more people around that could help instead. Another real life example of the volunteers’ dilemma can be seen with meerkats. When meerkats need to find food, at least one meerkat stays behind on the mound looking for predators. If a predator is seen, the meerkat makes a distress call so all the other meerkats can burrow to safety. This then puts the meerkat on watch at a greater chance of being caught by the predator, but if they did not do it, the whole mob could have been attacked. If none of the meerkats kept watch then they could have all suffered. 

As mentioned above, game theory is often used in parlour games such as poker. As an avid poker player myself this is one of my favourite uses of the theory, as it can be used to gain a great advantage over the other players. But, before we get to that, let’s start with a little introduction to poker, and specifically Texas Hold’em poker. The game starts with each player being dealt two cards which only they can see. There is then a round of betting where each player can either fold (not take part in that round), check (still participate but not bet any wager) or bet. Three ‘community’ cards are then dealt for all the players to see. Another round of betting then takes place where they can now fold, call (match the bet of their opponent) or raise (bet any amount on top of their opponents bet). Another card is then drawn, more betting, then a fifth and final card is drawn before the last round of betting. The aim of the game is to get the highest hand out of all the players and win all the money that was bet in that round, called the pot. The figure below shows all of the possible hands in order from best to worst.

Hopefully, it is clear that the more likely your hand is to win, the lower the probability of getting all the cards that make up that hand. For example, let’s take the best hand; a royal flush. To find the probability of getting a royal flush we need to divide the number of ways to get a royal flush by the total number of possible hands. There are 2,598,960 possible unique hands and there are 4 possible ways to get a royal flush. Therefore the probability of getting a royal flush is 0.00015%.  If we look at a straight flush, there are 36 possible ways to get a straight flush (9 possible ways in 4 different suits) so the probability is 0.00139% . Compare this to the probability of getting a pair, 42.26%, and it soon becomes clear why some hands are considered better than others. This is the logic behind betting and pot odds. Pot odds represent the ratio of the total pot (total money already bet by the other players) and the money you are going to bet. Let’s say the three players before you bet 50 pounds so the pot is 150 pounds and you decide to call their bet (which would mean you bet 50 pounds to match their bet). The pot odds are 150:50 or simplified 3:1. This means you must bet a third of the pot in order to have a chance at winning the whole pot. You can turn this ratio into a percentage using the formula: amount bet/total pot after bet = 50/200 = 25%. This percentage is very useful when deciding when (or when not) to bet as generally, you only want to bet when you have a greater than 25% chance of winning the hand. 

Let’s go through an example. For simplicity let’s suppose there is just you and one other player playing this game. You have the 7 of diamonds and the 5 of diamonds in your hand and the current community cards are the Jack of diamonds, the 2 of diamonds and the 8 of diamonds. The current pot is £6.50 and your opponent just bet £4. The first step is to work out the pot odds. Given that you are going to call, your bet size is 4 pounds and the final pot size is 14.50 (current pot, plus their bet, plus your bet). 4/14.50 = 0.2759 and so the percentage is 27.6%. This means we must have at least a 27.6% chance of getting the hand we need to win in order for the bet to be worthwhile. So, what are the chances of us getting such a hand? (Where for now for simplicity we will just focus on our hand and skip estimating our opponent’s hand and whether we can beat it). Well, if the next community card is a diamond of any value it will give us a flush. We already have two diamonds and there are two in the community pile which means there are 9 diamonds left in the pack out of the remaining 47 cards (we include our opponents two cards here since we do not know them). So, the odds of us getting a flush are (9/47) x 100 = 19%.

There are of course other possible hands that might allow us to win. For example, if the next community card out was a 7 or a 5 we would have a pair. There are three 7’s and three 5’s left in the pack so the probability of getting a pair is (6/47) x 100 = 13%. Finally if the next card is a 4, then we would only need a 6 to make a straight (4,5,6,7,8). The same can be said if the next card is a 6, 9 or 10. Therefore, there are 16 cards in total that could be drawn in order to need one more card for a straight. Although this would not lead to a full hand, it has a 34% chance of happening. This means altogether there is definitely a 32% chance of the next card drawn giving you a flush (19%) or a pair (13%) plus a small amount of equity for the straight draw. Overall, this means it is a worthwhile bet and a novice poker player should place it.

However, more advanced players should not bet every time they have a good hand and fold every time they have a bad one because over time it becomes predictable and opposing players will be able to exploit it. This is the basis behind a strategy poker players use called game theory optimal.

Game theory optimal is based on the idea that a strategy used to win a single hand may not be the best strategy to use throughout the whole game, and it may not even be profitable in the long run. For example, let’s say you always bet or raise when you have a good hand and only check when you have a weak one. Although this may seem like a good strategy (why wouldn’t you raise when you have a good hand), a good opponent will be able to spot this pattern and fold every time you bet. To avoid this you want to develop a balanced range. This may sound complicated but don’t worry we’ll break it down into chunks. Firstly, a range is every hand that your opponent could logically have in that situation. This is often narrowed down as a game progresses based on their patterns of play. For example if you notice that one of your opponents who hasn’t made many bets during the game (we call these players tight) raises straight away you would expect that they might have AA, KK ,QQ, JJ or AK (or something around that range) because these are the best two card hands. If an ace then comes out in the community cards and that player only checks, you can eliminate them having AK or AA because this would have put them in a very strong position and you would expect them to raise again. Using strategies such as this, the very best players can sometimes pinpoint an opponent’s exact hand. If your opponent thinks that they know your range, they are able to compare their own hand to what they think you have and make a more informed decision on whether to bet. We can avoid this by having a balanced range. A balanced range means you could have a variety of hands in the eyes of your opponents in any situation, which is achieved by varying your playing strategy. This means you should check strong hands some of the time and also bet some bluffs. Ultimately, having a balanced range makes you harder to read and therefore harder to play against. 

The final aspect of poker that we will discuss is expected value. Expected value is the amount of money a certain play (or hand) expects to win on average. Let’s take a non-poker example to start with. Suppose a friend offers to pay you a pound every time she flips a coin and gets a head, but if it’s tails you have to pay her 50p. If it’s a fair coin, the probability of getting a head or a tail is 1/2. To work out the expected value, you multiply the results of the possible outcomes by the probability of them happening and add them together. So here the expected values is:

EV = (1 x 0.5) + (-0.5 x 0.5) = 0.25

This means that on average you will win 25p per flip for any number of flips. This hopefully makes sense intuitively because based on probability you will get one head and one tail in two flips, meaning you will win £1 and lose 50p over two flips on average, resulting in a total net gain of 50p.

Now let’s return to poker. We have the 10 of spades and the 7 of spades in our hand, and in the community pile we can see the 4 of clubs, the 6 of spades, the Queen of spades, and the King of hearts. The only winning hand we can make is a flush. As before, we can use our pot odds to find the probability of getting a flush. There are 9 spades left in the pack of 46 cards and so the probability of getting a flush is 9/46 = 20%. The current pot is £150 and you need to bet £50 in order to match the bet your opponent has just made. This means if you get a flush you can win £150 otherwise you lose £50. The expected value is therefore given by

EV = (150 x 0.2) + (-50 x 0.8) = 30 – 40 = -£10

This means every time you call this bet in order to try and get your flush, you will on average lose ten pounds. It is therefore a negative expected value and we should fold. 

As we have seen in this article, there are many things to consider when playing a game of poker. And in fact, there is no optimum way to play the game – it is all down to the individual player. In a single game most players use a range of techniques to try to gain the upper hand on their opponents. Tactics such as pot odds and expected values can be used in even the lowest stake games, although usually only one is used at a time as they give you roughly the same information upon which to make your decision. Game theory, however, is only usually used in high stake games where skilful poker players are able to exploit each others weaknesses to gain the smallest advantage. And who knows, if you learn the above techniques and keep practicing, maybe maths can one day help you to win money!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s