[Math] Combinations of Tic-Tac-Toe

combinatorics

Just wanted some quick input if my reasoning is correct. Here is the scenario: 2 players play a game of Tic-Tac-Toe. Player 1 always starts first and places an o (in an unmarked cell), Player 2 places an x next (in an unmarked cell). Both players continue alternating until all the cells have been filled (3×3 grid of cells).

How many unique ways is there to completely mark the 3×3 grid?

So what I did is broke it down to 9 tasks:

  • T1: $P_1$ places $o_1$ => $P_1$ has 9 choices to do this move.
  • T2: $P_2$ places $x_1$ => $P_2$ has 8 choices to do this move.
  • T3: $P_1$ places $o_2$ => $P_1$ has 7 choices to do this move.
  • T4: $P_2$ places $x_2$ => $P_2$ has 6 choices to do this move.
  • T5: $P_1$ places $o_3$ => $P_1$ has 5 choices to do this move.
  • T6: $P_2$ places $x_3$ => $P_2$ has 4 choices to do this move.
  • T7: $P_1$ places $o_4$ => $P_1$ has 3 choices to do this move.
  • T8: $P_2$ places $x_4$ => $P_2$ has 2 choices to do this move.
  • T9: $P_1$ places $o_5$ => $P_1$ has 1 choices to do this move.

I notice that this is a factorial so there are $9!$ unique ways to fill out the grid. $9! = 362,880$

Next, what is the number of fully marked 3×3 grids. For this I realized that player 1 would always make 5 picks as they always start fist (and we completely fill the grid), and player 2 would always make 4 picks. Therefore I can calculate this using a product rule: $C(9, 5)*C(9,4)=15,876$ completely filled grids.

Thanks

Best Answer

I'm not entirely sure I understand what you're trying to do, since you perform two distinct calculations but you seem to be talking about it as if there were only one.

In any case, your first calculation is correct; there are $9!$ different sequences of play in Tic-Tac-Toe.

Your second calculation is wrong. Once you select $5$ spaces for the first player, the grid pattern is fully determined; there's not a second freedom of $\binom 94$ choices. (Note, by the way, that $\binom94=\binom95$.) So there are only $\binom95=126$ different resulting grid patterns in Tic-Tac-Toe.

Related Question