Determining simulation threshold

89 Views Asked by At

Let's suppose we have some sort of game (for instance tic-tac-toe) with a limited amount of moves. I want to simulate that game, and with that I will use a random number generator (RNG) to calculate the moves.

In the case of tic-tac-toe, there are at most $9!$ moves (if we forget about the games that end before the last move). If I were to run that number of simulations, there is no guarantee that I've ran all possible scenarios due to the inherent randomness of the process. The only way I would have ran all scenarios is if the RNG would magically pop out a straight sequence of moves.

Assuming my reasoning to be correct, I ask if there is some way to determine a threshold or a probability of cases run that would allow me to set a representative number of simulations?

Storing the moves and looking at what was made is not, for this purpose, an option.

1

There are 1 best solutions below

0
On

It's not so simple as mjqxxxx said, because the way you would presumably use the random numbers is to decide the move at each step, and not to choose an entire game out of the whole set of possibilities. In that case it's not trivial at all. Consider a game whose tree looks like a completely biased binary tree. If each move is randomly selected from among the two possibilities with equal probability, then you will get the same one-move game half the time, and the same two-move game $\frac{1}{4}$ the time, and so on.. It's much harder to cover all the possible games in this case, as compared to a game with a balanced tree.