# How a poker bot uses math and probability models to calculate odds in a game

Even before the arrival of online poker, researchers were using the challenge of poker to develop bots to play the game. The game of poker is what is known as an ‘incomplete’ game, that is you never know what your opponent’s hole cards are, so your data about any hand is always incomplete. Playing essentially blind in this way represents a significantly more complex game to learn than checkers or chess, for instance.

Modern AI driven poker bots are extremely capable, even beating multiple professional poker players at once in some cases, but how do they do that? What do they do to understand the game so well and develop the right strategies to win?

**Importance of Mathematics in Poker Bot Development**

Mathematics is at the heart of how poker bots operate, in fact it is at the heart of how many professional players approach the game too. AI poker bots use a database of previous games in combination with a range of probability driven mathematical analyses to assess the current hand and game situation, and find the response that is most likely to deliver the result that it wants.

Without mathematics, a poker bot cannot predict how the game will go and select the right strategy, so in that sense, without mathematics, there cannot be a poker bot. But it is more than that, because players do the same thing. One of the central concepts of poker for serious players is hand value, which is based entirely of mathematical calculations. Every distinct aspect of poker as it is played by humans and AI algorithms, is founded in mathematics, rather than the game of chance or a simple gamble that some involved in poker still believe it to be.

**How a poker bot uses mathematical probability for success**

Poker bots use mathematical computation in a number of ways. From analysis of bid size to predicting possible outcomes of each possible option, a poker bot makes choices based on mathematical probability and statistical analysis.

It does this by performing calculations based on its database of previous hands, working out what is most likely to happen in a given situation based on what has happened in similar hands previously. By using real data from real hands played, whether that is hands played against itself or data from real games against human opponents, a poker bot is always looking for the most likely option that will deliver success, creating a poker strategy optimized for that game in real time.

**Understanding Probability and Statistics in Poker**

Statistics and probability are central to understanding poker for human players and poker bots. Probability is the likelihood of something happening on a scale of 0 to 1. Where 1 is a certainty it will happen and 0 meaning it cannot possibly happen.

In poker, many decisions made can be analyzed using this probability scale. A great example of this is hand strength. Hand strength is entirely about whether a hand is likely to be the strongest in that particular game, and that is another way of expressing that probability. While the player with the best hand doesn’t aways win a game of poker, it is a good indicator of how well a poker bot may do.

Statistics look at the makeup of a situation. Expressed as a percentage, it applies again to most types of action in poker. Statistics could tell you that a player on your table will make aggressive bets 60% of the time when they have a weak hand, when they go all-in, when they raise a stake and so on. With a poker bot recording all data on every hand, you can build a reliable understanding of how a player behaves and use that within any probability assessment.

**Role of Mathematics in Decision Making in Poker game**

The key use of mathematic calculations is to assess how likely something is. The probability of having a certain hand after a dealer has put down cards at the flop and given the hole cards you receive, the expected outcome from a given hand, bet sizing, all use mathematics to provide the optimal choice during a hand of poker.

Any decision, whether to raise or call, fold or bluff, making an aggressive move and so on, are all dictated by mathematics. This is true with any version of poker and however many players at the table you are joining. In each case, the poker bot will assess the likely outcomes of their choice and select the one that has the highest probability of achieving the goal that round.

**Key Concepts: Odds, Expected Value, and Equity**

While mathematics is present in almost every choice made in a hand of poker, there are three key concepts than stand out, odds, expected values and equity, but what are they?

**Odds**

Pot odds are a representation of whether a specific call could be profitable by the end of the game. It is the ratio of the pot total to the call. So, for instance, if the pot is $100 and you are betting $20, then you have 5-1 pot odds. Another way of looking at it is that a win will give you 5 times the money you risk by calling at that point.

**Expected Value**

Expected value, or EV, indicates the potential profitability of a specific action. This is a complex calculation that brings together the statistics of how a play may be responded to by other players with the probability of each outcome and the profit that would deliver.

**Equity**

So far, our ideas of assessing poker decisions have focused on know things, how other players respond, the cards we have and so on. But the key challenge of poker is that there are unknowns that we must consider too. Other players cards and cards not yet revealed. Equity seeks to give value to these unknowns, and it begins with the idea of an ‘out’ card. These are cards that would improve the player’s hand and have the potential to win if you receive them.

An example would be a flush. If the hand has a 4 card flush after the flop, there are 9 more cards of that suit left somewhere. That is, there are 9 ‘out’ cards that could potentially provide the winning hand by the time the hand reaches the River. That works out at around 36% probability of one of those cards being drawn, or roughly 1 in 3 odds.

**Calculating Odds in Poker**

Poker odds are complicated by the fact that when playing a game there are many unseen cards,. To be able to calculate likely outcomes we must overcome that unknown factor. Calculating odds means identifying the number of cards that could give you a winning hand based on the cards you have. For instance, if you have a hand like a flush you could have 10 cards that could turn it into a winning hand. There are 2 cards you have and 3 flop cards, making 6. That means 47 unseen cards, including the 10 that can make your hand a winner.

The odds here are 37 non-winning cards to 10 winning, or 3.7:1. This same calculation can be made whether you are chasing two pair or any hand, simply determine the number of outs and cards left in the deck.

**Game Strategy Based on Mathematics**

This is where EV, expected value, comes in. The goal is to make the highest possible EV choice every time. This is sometimes referred to as game theory optimal, however it is not always possible. Sometimes game limitations mean a little compromise, but at all points of the game, the highest scoring EV choice within the rules is selected by the poker bot AI.

**Advanced Techniques in Poker Bot Mathematics**

Some more advanced bots reach beyond EV and pot odds and take into account opponent behavior, bluffs and more. Here, statistical analysis of a specific player’s history will be incorporated into EV calculations to better reflect the likely consequences of any action.

The very latest AI poker bots will also incorporate bluffing into their games, using aggressive betting patterns at times to avoid predictability. This not only enhances performance, but also allows these bots to avoid the anti-bot systems now present on many poker platforms.

**FAQ**

**What mathematical techniques do poker bots use to assess their equity in a hand?**

Equity calculations use probability to understand the likelihood of the player being dealt the cards they need to develop a winning hand. If there are 10 possible cards out of a possible 35 cards in the deck, then the probability is 3.5:1 that the card will be dealt.

**How do poker bots calculate post-flop odds and make decisions accordingly?**

Combining equity probabilities, pot odds and expected value calculations, poker AI will look at each option they have and select the one with the highest probability of success for whatever the goal may be.

**How do advancements in mathematical algorithms impact the capabilities of poker bots?**

Early poker bots were rudimentary products that could follow rules but were easy to beat by any experienced player. They couldn’t understand the concept of strategies, bet size, bluffing and so on.

Today modern AI can incorporate all these and more into its calculations when determining the best choice at any given time.