Tic-Tac-Toe

Games played on three-in-a-row boards can be traced back to ancient Egypt - wikipedia

caption

Combinatorics of all unique Tic Tac Toe boards

There is at 19,683 ($9^3$) different boards (but only 5477 are valid game positions). The number of possible move sequences is 362,880 ($9!$), this corresponds to the size of the game tree graph.

Considering symmetries: there is only 765 boards:

  • 138 are terminal board positions:
    • 91 distinct positions are won by first player (X)
    • 44 distinct positions are won by (O)
    • 3 distinct positions are drawn
  • 626 are midgames

Strategy

Player X can win or force a draw from any of these starting marks; however, playing the corner gives the opponent the smallest choice of squares which must be played to avoid losing. This might suggest that the corner is the best opening move for X, however another study shows that if the players are not perfect, an opening move in the center is best for X.

Divers

Written on June 8, 2021, Last update on May 1, 2022
tic-tac-toe xkcd