Tallying monte carlo simulation and ties for Texas hold'em

I'm writing an odds calculator for Texas hold'em (assuming all players remain till showdown) and I'm unsure about how I should be tallying scores when taking into consideration ties.

Basically, if I am running the simulation for a thousand iterations I can increment a score counter by 1 for wins and leave it unchanged for losses. At the end of the simulation I would simply divide that number by the total number of simulations run.

However, I'm unsure on how to treat ties. My approach to this at the moment is to decrement the total number of simulations when a tie occurs (that is, stopping the simulation earlier at 999 iterations instead of 1000 simulations thus nullifying the round).

I also take into consideration that the tie might not be against all players. So if there are 3 opponents at showdown and my hand beats 2 and ties with 1, then the total number of simulations is not decremented by 1, which would be the case if there was an all around tie, but by 1/3.

• Don't make your program complex just for this; Ties are rare and you'll find that they are occuring about `1%` at best in all situations. You should treat ties as wins by all tied players (they get a share from the pot, aren't they?).
– user1165
Jul 19, 2015 at 18:19
• My only interest is the players point of view because the opponent cards are unknown. I think disco beat's reply makes a lot of sense so I'm tallying ties separately. I'm also keeping separate tallies depending on how many opponents I tie with. The results would show the probability of a tie with 1,2,...,n opponents as separate results. Jul 20, 2015 at 10:10
• 1000 hands is not nearly enough to get accurate probabilities. You really ought to be simulating more on the order of millions. If your code isn't fast enough for that, consider using a library like my lcrocker.github.io/onejoker Jul 20, 2015 at 16:11
• @StefanMallia That's good, you need that information to calculate the actual equity each player has: `100%*(numberOfWins + numerOfTwoWayTies/2 + numberOfThreeWayTies/3 + ...)/numberOfTrials`
– Paul
Jul 20, 2015 at 18:16