I have a toy problem I've been playing with simulating for fun and learning, and I'd like to have a deeper understanding of the math involved. So, I'm curious:
Given a randomly-played game between two players who don't even know the rules, how would I calculate the odds of the four possible outcomes: x wins, o wins, draw, invalid game
To elaborate, on each turn, each player is playing randomly without even knowing what the legal moves are. So the 'x' player might try to play an 'o' (resulting in an invalid game), or might try to play an 'x' in a square that already contains an 'x', etc.
In my simulations, I see a majority of invalid games (as one would expect), and some games where 'x' or 'o' wins, but I almost never see drawn games. Intuitively this makes sense because a draw requires all 9 squares to be filled in, which means the odds of an illegal move by that point are at their highest. However, I'm seeing so few draws I wonder whether there's a bug in my simulation code. But I can't verify that without a deeper understanding of the mathematics!
But how would I calculate the true odds involved in each outcome?
Thanks!