0

So I am currently trying to develop an algorithm for a poker odds calculator to predict the probability of a hand winning during the flop, turn and river in Texas Hold'Em as a side project. After reading this thread, I am still very confused on how the number of players will affect the probability of a player's hand winning.

Can someone please explain how I would go about calculating the probability of a hand winning and how number of players would affect it? I've looked into this resource, but I still don't understand how number of players would affect probability. Also, what other factors do I need to consider?

I would like to assume that all player's are of equal skill and we are solely using the information we have gathered from the player's card and community cards. Thank you. To be honest, I don't know where to start and this is very confusing to me and I would appreciate help.

EDIT: Added my comment from below so it is more noticeable.

Skill definitely has an impact in real life but since my goal is to develop an program, we can't really implement 'skill'. My goal was to try developing the probability of a poker hand winning so I guess I should be investigating the probability of a hand improving during the flop and the turn and then once it's the river, predict the probability of it winning? Please someone guide me. I just want to know if this project is still plausible.

EDIT #2[COPIED FROM BELOW]: After thinking for a while, I was thinking I take this approach.

I was thinking that the other player cards are unknown. I was thinking that for the flop and turn, I calculate percent of improvement (outs/unseen cards). Then on the river when all cards are revealed, I go through each permutation of the deck and determine all possible card combinations other players would have. I find the number of scenarios which the player has the best hand and then divide that by all scenarios. Can I get feedback from anyone?

6
  • A hand does not win until the river. A calculator cannot deal with skill. It is not an algorithm. It is just pure statistics on if it will be the best hand at the river. Clearly it is harder for a random hand to beat 8 random hands then beat 1 random hand. Look for a book on poker statistics.
    – paparazzo
    Commented Dec 6, 2015 at 8:54
  • @Marcin I disagree. There is nothing wrong with simplifying by adding assumptions.
    – Paul
    Commented Dec 6, 2015 at 17:38
  • Skill definitely has an impact in real life but since my goal is to develop an program, we can't really implement 'skill'. My goal was to try developing the probability of a poker hand winning so I guess I should be investigating the probability of a hand improving during the flop and the turn and then once it's the river, predict the probability of it winning? Please someone guide me. I just want to know if this project is still plausible.
    – user3875
    Commented Dec 6, 2015 at 19:33
  • @Frisbee I stand by my statement. Assuming skill is not a factor (the same thing as saying all players have equal skill) is a valid simplifying assumption.
    – Paul
    Commented Dec 7, 2015 at 0:29
  • FWIW, flopzilla is a good tool for seeing how often a range (or a single hand, which is just a very specific range) improves on the flop, turn, or river. If nothing else, you might use this for ideas or to check your work. Commented Dec 7, 2015 at 3:34

2 Answers 2

2

Stop saying winning. The best hand often does not win as it is folded. And can win without the best hand as a better hand was folded.

You will see top pros like a durrr win with marginal hands a lot because they just know how to play them.

All an odds calculator can do is give you the odds that it will be the best hand at the river. You have to do statistics with all the possible outcomes (you and your opponents) and get the odds. And you need to run the hands - if the ace goes out in position 1 then position 2 cannot get that ace. This is called a brute force analysis.

Marginal hands are clearly more likely to be folded but you pretty much have to assume random hands were played or it gets complex fast. You just assume all hands are played to the end. Understand it is a statistical calculation and should only be used as a guideline in playing the hand.

At the deal you just take your two card out of the deck and run every possible deal for X hands. If it is 20 million runs and you win 1 million then you are 1 in 20. After the flop you take the 5 known cards out of the deck and turn run them again. The calculator is still valid after the river.

Once you get the algorithm for running the deck to X hands it is pretty easy. Remember position does not matter so you don't have to account for hands in different order.

I ran some analysis and it is a lot of runs. Even with a fast computer it would be hard to beat the clock for more than 4 players with current computing power. 8 players would be years of computing time. Could look at the hand and dismiss any hand that is drawing dead (including yours) ASAP. But if you had a hand like 8,9 suited there are so many ways to win and lose you would end up running pretty much every combination to the river. You also might want to run the best hand starting first to the river as you only need to lose to 1. You could use pruning from machine learning. Current odds calculators for multiple hands just look at a large number (like 20 million) random deals.

You don't win at the flop or turn. All you do is get more information on if you will have the best hand at the river. And improve is not really a factor as you could improve and still reduce your odds of being the best hand at the river. If you pair a 8 on 8,9,10 suited but don't have any piece of that straight or flush then your odds go down.

Your odds of improving is very simple. You just take the number of outs divided by the number of unknown cards. I suggest you start with a book on getting your odds to improve and you will get an idea on odds as a whole. If you don't have degree in statistics or machine learning then writing a total odds calculator may be a bit of a reach.

As for number of player your hand is random. If you have jacks against just one player then you only have to beat one hand. Jacks against 7 hands then that is 7 chances of a better hand.

And for players it is more about expected value. How much can you win. If you fill up straight with 6, 9 it is disguised. You will play a wider range in late position as you can get paid off bigger.

A pure statistical calculator in poker is just not of much value. Typically you set guidelines for what type of hands to play in certain position with so many hands in the game.

2
  • Sorry, I would like to ask another question for clarification. When I calculate the odds for improving, the number of players does not have an impact on it?
    – user3875
    Commented Dec 7, 2015 at 0:47
  • 1
    @royalbluffer It has no impact. A down card is an unknown card. Like I said a said a mucked hand is likely a poor hand but you just plain ignore that as it could get crazy. If you are looking for an 8 mucked hands are good. If you are looking for an ace mucked hands are bad. In the end for statistics you just (have to) assume a mucked hand is random. Like I said you have to run the statistics as statistics and then understand the statistics in deciding your play.
    – paparazzo
    Commented Dec 7, 2015 at 2:06
1

First, I'll try to answer royalbluffer's question about whether a hand's probability of winning changes with the number of players. I will assume that by "winning" he means "is the best hand at showdown, and every hand will make it to showdown." I think this parallels paulpro's comments on the original question, FWIW. The short answer then is yes. If you have a random hand and you have only one opponent with a random hand, your equity in the hand is 1/2, or 50%. If you have two opponents, your equity is 1/3. And so on... with X random opponents, your equity in a hand is 1/(X+1). Of course this doesn't correspond to "real" poker where the act of actually playing poker may cause some of those hands to drop out by folding, but that's independent of the calculation of the chances of a hand being the best hand on a given board. If you know the specific hands involved, then you can of course enumerate the possible outcomes given the remaining cards in the deck and determine the equity of each player's hand.

Your question uses the phrase "the probability of a hand winning," which implies that for the purposes of your app, you will know the exact cards that all players hold. Most tools now will allow you to specify a range of hands for each player, which more closely approximates "real" play, since you may be able to narrow down an opponent's possible holding, but can hardly ever know with certainty what your opponents exact cards are while the hand is in process. You can of course assume that your hand ranges are simply just the specific hands you assign, which simplifies the calculations.

If you're interested in creating such a tool, know that several really good tools already exist that do similar probability calculations. Here are two examples of things to check out:

PokerStove lets you compare ranges of hands against each other to see the odds each has of being the best hand at the river. You can add board cards, too, and the output is the equity of each hand and the odds of winning. It's also open source and uses an open source enumeration library called pokenum that's been around forever which you might consider using in your own example app.

FlopZilla addresses a question you had about how often a player's range improves to various target hand types, like top pair, two pair, flush draw, etc. This app doesn't compare arbitrary numbers of multiple hands against each other, but it can give you an equity calculation of a single hand against another range. It's complementary to PokerStove in many ways.

9
  • I was thinking that the other player cards are unknown. I was thinking that for the flop and turn, I calculate percent of improvement (outs/unseen cards). Then on the river when all cards are revealed, I go through each permutation of the deck and determine all possible card combinations other players would have. I find the number of scenarios which the player has the best hand and then divide that by all scenarios. Can I get your feedback on this approach? Thank you!
    – user3875
    Commented Dec 7, 2015 at 8:03
  • I guess I don't know what you mean with "determine all possible combos other players would have." Part of the value of applying ranges to your opponents is using them on all streets in order to help inform your own decisions during the hand, so waiting until the end for this doesn't add a lot of value. Your own hand's odds of improving is only part of the story. You might have good odds of improving to a straight on the river, but if there are 4 clubs on the board your potential straight is only a bluff catcher. Commented Dec 7, 2015 at 15:03
  • It's not really clear to me whether you want to do this as an academic exercise or whether you want to create a tool that's useful to the community of poker players, or both. And it's not clear to me what specific help you want to give a user of your app about the value of their hand. I suggest looking at pokerstove and flopzilla with some hand histories where you get to a showdown and watch how the equities change on each street. You can cheat and work backwards from your opponent's known hand to build his range. I think that would be informative to someone like you in creating a useful app. Commented Dec 7, 2015 at 15:08
  • One good example with flopzilla is that you can assign a pre-flop calling range to your opponent. Then you can see how often that range hits a specific flop in different ways. The probability of a strong flop hit by your opponent will help you decide how to bet the flop, whether for value or as a bluff. If you wait until the river for this sort of enumeration, the value is sort of lost. Commented Dec 7, 2015 at 15:12
  • @royalbluffer If the other players cards are unknown, then you don't know which cards they have, so your odds of improving are unchanged. However, what you need to improve to in order to have a good chance of winning, change based on the number of players. For instance, heads up (2 players), one pair is usually good enough to win, but when 9 players enter the hand you aren't likely to win with anything less than a set (or depending on the board, a straight, flush, or full house).
    – Paul
    Commented Dec 7, 2015 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.