5

So there are Texas Hold'em computer games where you play up to 8 opponents and supposedly some of these computer games tell you your probability of winning assuming your opponents hands are all random. In case someone doesn't know, in Hold'em each player is dealt 2 private cards and then eventually 5 community cards are dealt in the middle (first 3, then 1, then 1 more), and the winner is the player who can make the best 5 card poker hand they can using any combination of their 2 private cards and the 5 community cards. In Omaha, each player is dealt 4 private cards and there are still 5 community cards and the winner is the player who can make the best 5 card poker hand using 2 private cards and 3 community cards.

So, in Hold'em, for any given player's private hand, there are over 10^24 ways that 8 opponents' private hands and the 5 community cards could be dealt. So how do they calculate/estimate your probability of you winning in the beginning, assuming your 8 opponents' hands are random? In Omaha the situation is even worse although I've never seen an Omaha computer game that actually gives you your odds against 8 random opponents' hands. But anyway, are there any programming tricks that can get these winning probability calculations done (or say, correct within 3 or 4 decimal places), faster than brute force? I'm hoping someone can answer here who's written such a program before that runs fast enough, hence why I'm asking here. And I'm hoping the answer doesn't involve random sampling estimation, because there's always a small chance that could be way off.

user2566092
  • 4,473
  • 12
  • 19

2 Answers2

5

As you identified the expected win rate is an intractably large summation and must be approximated. The standard approach is to use the Monte Carlo method which involves simulating various hands over and over and taking the empirical average: #wins/#games.

Interestingly, the (MSE) error of this approximation approach is independent of the dimensionality (number of combinations) specifically, letting X = 1 if you win, 0 if you lose, MSE = var(X)/N = p*(1-p)/N where p = Prob(X=1) (unknown), and N is the number of samples.

There are a whole host of different Monte Carlo techniques that can improve the variance of the vanilla sampling approach, such as importance sampling, common random numbers, Rao-Blackwellization, control variates, and stratified sampling to name only a few.

edit: just saw you are looking for a non-random approximation approach, I doubt you will have much luck with deterministic approximations approaches, I know that the current state of the art in compute poker research uses Monte Carlo methods to compute these probabilities, albeit with several variance-reduction tricks.

Regarding "because there's always a small chance that could be way off" you can always get a high probability bound on the error rate with Hoeffding's inequality.

fairidox
  • 3,130
  • 2
  • 26
  • 28
  • If sampling is the current state of the art then I guess that's just the way it is. It's sad though that there's still a very small chance that some of the computed winning probability estimates are way off. And there are (52 choose 2) chances for that to happen. Thanks for your response. – user2566092 Oct 23 '14 at 18:46
  • @user2566092 there isn't a chance that the estimates are way off you -- can upper bound this, if we have empirical mean $m = 1/n \sum_i X_i$, we have from Hoeffding's IE that Pr(|m - E[m]| > t) <= exp{-2nt^2}, setting the RHS = \delta, and observing that X <= 1, we have that |m - E[m]| <= sqrt(log(1/\delta)/(2n)) + 1*(\delta). Given your accuracy (4 decimal places or whatever) you can then determine the required value for 'n' – fairidox Oct 23 '14 at 22:29
  • I agree with everything you're saying, but the fact remains that you could estimate the winning probability to be 1.0 even though it's actually more like 0.5, if you are very, very unlucky in your sampling. I know I'm talking about chances that can be much smaller than the chance of having a computation error due to cosmic radiation, if the sample size is large enough. But still, the chance is there. There is no way using sampling to ever get that the chance of a large deviation is 0. – user2566092 Oct 24 '14 at 19:19
  • There are actually only 169 meaningfully distinct starting hands (not 52 choose 2). The chance that As5c will win will be the same as the chance that As5h, etc. So there are 13c2 = 78 pairs of distinct cards which can be suited or unsuited (for 156 possibilities) and 13 possible pocket pairs. The time required to calculate *very* reliable equity tables for each one is just not that great. – Julian Oct 26 '14 at 01:24
0

I would use a pre-computed odds table instead of on-the-fly computation. Tables that list these are extremely easy to find, and have existed for quite some time so they are proven tools. It would be fairly simple to match your hole cards + community cards to the percentage listed in a pre-computed table, and return the value to you instantly, skipping on-the-fly computation time.

There are only 52 cards in a deck(classically), so if you simply find all the possible solutions ahead of time it is much faster to read from those instead of re-computing the odds for every hand on the fly.

Here's a link to an incomplete odds table: http://www.learn-texas-holdem.com/texas-holdem-odds-probabilities.htm

I'd think about it like password-cracking. Instead of brute-forcing every character individually, use a list of common password to decrease compute time. The difference in this case is you know every possible combination ahead of time.

Lee Harrison
  • 2,045
  • 16
  • 30
  • But even pre-computing seems to require some sort of tricks if exact probabilities are desired because for 8 random opponent hands in Hold'em there are something like 10^21 possibilities for opponents' hands ignoring the ordering of the opponents, and it goes up to 10^24 possibilities if the middle 5 cards haven't been dealt yet. In Omaha the number of possible opponents hands for 8 opponents is something like 10-20 orders of magnitude even higher. – user2566092 Oct 23 '14 at 18:41