What are the symmetries of the tic tac toe board game? In other words, what are the ways you can rotate, reflect, and/or flip the tic tac toe board, such that the next best move to a board (before it was rotated, reflected, etc) is still the next best move after the board was rotated/reflected/flipped? How would I also construct a group multiplication table for these symmetries?
-
3Please show some work. – hmakholm left over Monica Oct 17 '11 at 00:17
3 Answers
This may be a more subtle question than it seems at first sight.
The easy answer might be that the board is a $3\times 3$ square and so you are looking at the symmetry group of a square.
However, the number of possible different games is known to be 255,168 ignoring symmetry and 26,830 taking symmetry into account. Surprisingly, the latter number is less than one-eighth of the former. The way I once tried to explain this was
- the first diagram below is equivalent to the second using a reflection in the line between the top right and bottom left, so they can both be considered as being the third;
- therefore the fourth must be equivalent to the fifth, since they are both essentially the sixth, which is simply the third with two extra moves.

- 169,616
-
1On the other hand, if one simply numbers the moves consecutively, the first and second are equivalent under a reflection, but the fourth and fifth aren’t: in the fourth move $4$ is adjacent to move $1$, while in the fifth it’s adjacent to move $3$. Under this stricter (and in my view more reasonable $-$ the order of the moves is part of the game) notion of equivalence I believe that you do get the expected number of different games. – Brian M. Scott Oct 17 '11 at 00:57
-
@Brian. Indeed. You get 31,896 possible games (one eighth of 255,168) with your rather less exciting definition of symmetry. – Henry Oct 17 '11 at 00:59
-
-
You're counting the games rather than board positions (for the latter, play order does not matter). I wonder how many board positions are there, with or without symmetry? – Yan King Yin Nov 21 '24 at 19:47
-
1@YanKingYin This is known to be $5478$ positions of which $958$ are end positions (consistent with the $255168$ games ignoring symmetry), or $765$ positions of which $138$ are end positions (consistent with the $26830$ games taking symmetry into account), in both cases knowing which player goes first. – Henry Nov 21 '24 at 22:40
-
Thanks, your answer is the best. The dihedral group is the right group of symmetry. I wrote a simple Python program to enumerate the equivalent classes of boards. Lagrange's theorem seems to suggest the quotient should be 1/8 the size, but the program found out it's not. Perhaps some elements such as the empty board are degenerate in some sense? Maybe the theorem simply does not apply here... – Yan King Yin Nov 23 '24 at 00:54
-
(Sorry, last comment is nonsense... the symmetry group acts on board positions which are nodes of the game tree, or just a set. There's no group‐subgroup relation here.) – Yan King Yin Nov 23 '24 at 08:53
Why isn't the total number of possible games 362880? That would be 9*8*7*6*5*4*3*2.
-
5Because it is possible for the game to end before all 9 squares are filled in. – fixedp Sep 14 '14 at 14:03
-
I once made a ticktacktoe AI, and in order to keep my potential outcomes small I rotated the board. When the user would make a choice I rotated the placements on the board so that the mouse would be over one of two options that the AI was concerned with. If AI takes mid he now thinks the only choices for the user are bottom-right and bottom-middle. If you chose top I would pass the second choice bot-mid and do a 180 flip to the board so you would choose what appears to be top-mid. I hope this helps.