# Odds Calculation Texas Hold'em

I have created an odds calculator and now I want to check if the calculator gives me the correct results. In my program I use Monte Carlo to calculate the odds. The results from the calculator should be compared with the results I am getting by doing the math. This is a site I have found which explains how to calculate the odds: http://www.pokerology.com/lessons/drawing-odds/ (look at chapter Doing the Math – Crunching Numbers) but it calculates the odds for a flush draw and I want the odds for a win.

Here's a situation (how to calculate the outs and after that the odds for player 1 to win?)

• If you already coded your program, you then can use Pokerstove directly to test if your results you get are correct. Instead of Enumerate all selection bottom-right you select Monte Carlo.
– user1165
Commented May 8, 2015 at 9:50
• Okay that's a nice way to test it, but I also have to compare the results from the calculator with results from the maths (as I explain in my question). Commented May 8, 2015 at 9:55
• i have as well developed such an evaluator, although what i do is just simulating a big number of 7-card hands between 2+ players to find the percentage of win you're seeking about. I doubt if there's a formula to calculate the winning chance, either preflop or on flop without actually simulating a ton of hands.
– user1165
Commented May 8, 2015 at 14:03
• I do it the same way just run a simulation an x number of times. Thought maybe there's a formula for it, to check the outcomes of the calculator Commented May 8, 2015 at 15:18
• My favourite site for calculating odds is propokertools.com. Especially if you don't confine yourself to boring old holdem and play the other variants as well.
– wvdz
Commented May 16, 2015 at 21:18

As far as the math for determining this, it gets very involved and complicated. The basic formula is the same though, the cards you can hit to win / the total remaining cards unseen.

Now I'm sure the problem your having in the situation you posted is that you don't know the other players hole cards. That throws a wrench in the works.

Since you don't know the other players cards, the best way to calculate this would be to calculate all the other players chances of winning (using your hole cards to offset the available card pool).

Now, there is one piece of critical data you will need to get based on your hole cards before this will work, and that is what is the WEAKEST possible hand you can hit. This is the hand that the other player must beat to be included in your calculations. So when you run the calcs for the opponents, you must also include a check for every hand that says "can this beat our players weakest hand". Also, another check will be required that says "will this hand improve our players hand as such that it will beat this hand". If it will not beat our weakest hand or it will improve our hand enough to beat the opponents hand in that particular situation, we exclude it from the calculations described in the next paragraph.

Pre-flop you will have the same formula for opponent odds every time because you don't know the opponents hole cards and you don't know what's going to flop. So you simply create a function that calculates all the hands and what the odds are of hitting them, be sure to include a way to remove your hole cards (the only known cards at this time) from the available card pool. You then run the checks described in the above paragraph, removing any hands that don't qualify.

Then you aggregate the remaining data to determine each opponents chance of beating our player. You then only want to take the opponent with the highest chance of winning and compare with your player. As this type of calculation does not take into account players bets, bluffs, etc.. and only calculates based on the cards and their chance to hit so basically assumes every player is all in pre-flop if you want to simplify it. So you only need to compare with the guy who has the best chance of winning. It's hard to explain why, but its right. (I think, maybe, but not really. haha) :)

I really like the wizard of odds site, it has some great info...

http://wizardofodds.com/games/texas-hold-em/

as well as a calculator that i have been using myself when coding little programs and helpers and stuff to analyze my game...

http://wizardofodds.com/games/texas-hold-em/calculator/

Hope this helps a little, it's a big undertaking for sure as the calculations involved are pretty complicated. I'm probably going to play around with trying to code something like this just for my own personal education so keep us updated with your progress on this and I'll help along the way as much as I can with the math, calculations, etc..

I will code mine in PHP using javascript/jquery for front end and mySQL for database and put it online. What language are you coding yours in?

• Thanks for your reply. I already managed to check if the results are correct. My teacher made his own implementation of an odds calculator and we are getting the same results, that's enough to convince him that the calculator is correct. My results are also equal to the results of online calculators I tested. I used Java/Swing for the interface and MySQL for the database. Commented Jun 30, 2015 at 6:43
• Good job! Glad you got it figured out. Commented Jun 30, 2015 at 8:42
• You could probably calculate this quite quickly with my lcrocker.github.io/onejoker/cardlib Commented Jun 30, 2015 at 15:56