Why tic-tac-toe is always a draw
Tic-tac-toe is small enough to solve. Play a machine that never errs, see which first moves are safe, count every game that can be played and find the best move in a position.
Key takeaways
- If both players make no mistakes, tic-tac-toe is always a draw.
- There are 255,168 different games, and 5,478 positions that can arise. Counting turned and mirrored copies as one leaves 765.
- Cross wins 131,184 of the games, nought 77,904, and 46,080 are draws. These count every possible game once. They say nothing about who wins in real play.
- Every first move gives a draw with perfect play. The corner is the best try against a player who errs, because most replies lose.
- A computer plays perfectly by looking at every continuation and choosing the move with the best worst case.
Sources
Most of these sites could not be opened while this page was written, so the facts were checked through search results that quote them. That the game is a draw with perfect play, 255,168 games, 5,478 positions, 765 positions up to turning and mirroring, the split of 131,184 wins for cross, 77,904 for nought and 46,080 draws, and the idea of minimax each appeared in at least two places. The page also computes the counts itself from the rules and they match. Sources disagree on the number of games up to turning and mirroring, so the page gives no such figure. The advice about which opening to choose is a general observation, not a rule, and the page says what it counts.
- Wikipedia: tic-tac-toeThe rules, the game counts and the draw with perfect play.
- Wikipedia: game complexitySize of the game tree and the positions.
- Wikipedia: minimaxHow a perfect player chooses a move.
- Wikipedia: solved gameWhat it means that a game is solved.
- Brilliant: tic-tac-toeStrategy and the opening moves.
- Stack Overflow: how many tic-tac-toe gamesThe count of 255,168 games and 5,478 positions.
- Cornell: games and strategy notesMinimax search and scoring, with Gomoku as the example.
- Wikipedia: noughts and crossesThe British name and history of the game.