What is a monte carlo simulation?
With all this talk about pokerbots I’ve mentioned monte carlo simulations quite a lot. But what are they?
They’re a method of computation which use repeated random sampling to produce results. A simpler way of putting it would be “you try the thing lots of times to see what happens”.
A simple example would be calculating the probability of flipping two coins and getting two heads. We know the probability is 1/2 * 1/2 = 1/4. What if we couldn’t work that out? A monte carlo method to calculate the probability would be to try the experiment many times, record the results and see what proportion of the time both were heads. Obviously the more trials we perform, the more accurate a result we will get. We will never get a perfectly accurate result but as the number of attempts increases, the result will get closer to 1/4.
This example probably seems silly because the answer is so obvious. Where monte carlo methods come into their own are in problems which are too complex to calculate exactly. This is why they are so crucial to pokerbots.
Consider a game of heads up holdem. If we want to calculate our probability of winning a particular hand then we must compare it to all possible opponent hands. Suppose we are preflop -
- there are 50×49/2 = 1,225 possible opponent hands
- there are 48×47x46×45x44/120 = 1,712,304 combinations of board card
- that leaves us with 1,225×1,712,304 = 2,097,572,400 possibilities to consider
That’s not too bad for a modern computer to calculate, but this is the simplest case. Things quickly get out of hand as the number of opponents increases - e.g. two opponents have 690,900 possible hand combinations while nine opponents have 6.2211×1020 (622 quintillion).
Much better would be to simulate the outcome of the hand many (10,000 - 1,000,000) times. It is less computationally intensive and so will take less time. 100,000 trials will give us a winning percentage to an accuracy of several decimal places and we can adjust the number of trials to meet our desired accuracy.
Another advantage is that we can distribute the cards in the simulations in a non-random way. Suppose we know that an opponent only goes to the flop 20% of the time, we could include this information in the simulation and only deal him the top 20% of hole cards.
Probably best to continue that train of thought in another post though.




