Math Explorer`s Club – February 12, 2004

Tic-Tac-Toe-like games
Most of us are familiar with Tic-Tac-Toe: players take turns placing X’s and O’s in a
3x3 square and the winner is the person who gets 3-in-a-row. Of course, it is possible
that there is no winner – the game ends in a draw!
Here are two variations on Tic-Tac-Toe:
Achi:
This is a game played by the Asante people of Ghana, West
Africa. It is played on a board like the one to the right.
Each player starts with four counters (like X’s and O’s) and
takes turns placing them on the board as in Tic-Tac-Toe,
with the goal of getting a 3-in-a-row. However, if the game
is a draw after each has played their four counters, they
take turns sliding a counter along the lines into the space
left empty. The winner is the first player to get 3-in-a-row.
For example, if the players have played their counters as at
the left – first player in red and second in blue – and the
game is a draw, the first player then must slide the counter
in the bottom right corner into the open (white) space, and
then the second player slides one of his/her pieces, etc.
(Which piece would you slide if you were the second
player?
Note: The information on Achi is based on work done by Cara Crosby and Ethel Breuche for the Math Forum.
1) Can the game end with no winner? If no one won after placing the counters, can the
players always slide a counter until someone wins?
HINT: Suppose one of the players can’t slide a counter. What does the rest of the board
look like?
ANSWER: The empty space can be one of three positions up to symmetry: a corner, the
center, or a middle of the side of the square.
a) The empty space is at a corner (shown in white). If the next player can’t move, the
last player must have all the places around the corner which could move to the corner,
shown in blue below. The next player must have four of the yellow spots – but this
means that the next player already has a 3-in-a-row.
b) The empty space is at the center. Since every other spot can move to the middle, it is
impossible that the next player can’t move.
c) The empty space is on the side of a square (shown in white). Then, if the next player
can’t move, the last player has the blue places in Figure 1 below. Since they are sliding,
there is no 3-in-a-row yet, so the next player has the red spaces. The last player must have
the yellow space between the two reds.
Figure 1
Figure 2
This gives the final placement shown in Figure 2. This position could not occur
after one of the players slid a counter, since then the blue player must have slid a counter
out of this open place, so he/she must have had a 3-in-a-row before the move.
However, in order for this position (shown in Figure 2) to occur immediately
following the original play, the blue player must have had an opportunity to win in the
last move and did not. The blue player had the last move and could have chosen the open
place along the edge, which would have completed a 3-in-a-row, either horizontally or
vertically (depending of where he/she had played previous counters).
Since the players can always slide a counter, someone will win. If whoever is in
the middle stays there, all the sliding counters will move in a circle around the center.
When we consider the 7 counters around the outside (and one empty space), either the
player with his/her counter in the middle will have two counters which are separated by
exactly two of the other player’s counters and will eventually win (why?) or one of the
players has three counters in a row and will win when these are all along one side. These
are the only possibilities since if the player with the counter in the center does not have
two counters separated by two of the other player’s counters, two of this player’s
counters must be next to each other and the other player must have at least 3 counters in a
row.
2) Does either player have an advantage? If so, why?
HINT: Think about positions on the board that are advantageous for the players.
ANSWER: The center is the most important space, since four of the 3-in-a-rows go
through the center, and only three use the corners and two the places in the middle of the
sides. Therefore, the center has control over more 3-in-a-rows than any other space. The
first player has the opportunity to take this space and have greater control. In the answer
to the next question, we can see how this leads to a solution.
3) Do they have a strategy that guarantees they can win, no matter what the other player
does? If so, what does such a strategy look like?
HINT: If the first player starts with the center, what different moves could the second
player make? Can the first player respond to any of these moves and win?
ANSWER:
Not only does the first player have an advantage, as mentioned in question 2, but no
matter what the second player does, they will always be able to win if they play correctly
– that is, the first player has a winning strategy.
Since the middle space is so important, the first player’s first move should be to take this
space. Then the second player has a choice: to take a space along a side, or a corner.
Let the first player be red and the second blue.
Suppose the blue player takes a space along the side. Then the red player can win, even
without having to slide any pieces! The red player can respond by taking a corner next to
the blue player’s space, as shown below.
Then the blue player is forced to block the red player, as below.
Now the red player can play in the corner, as below, so that he has two possible moves to
get 3-in-a-row. Now, no matter which one the blue player blocks, the red player can win.
Can you find any other ways to win if the blue player goes along an edge?
Suppose the blue player plays in a corner. Then the first player can play in an adjacent
corner to the one the blue player played in. Now the players take turns blocking the
other, as shown in the sequence of moves below:
Now the red player can choose to play either in the bottom middle or bottom right. If he
plays in the bottom middle, the blue player is forced to play in the top middle or else the
red player will win immediately by sliding a counter. This gives the following:
Now the red player wants to maintain his position in the center, so he/she slides the red
counter in the bottom middle to the bottom right. The blue player must move his blue
counter from the bottom left to the bottom middle and finally the red player moves the
counter along the left side to the bottom left and wins. This sequence of moves is shown
below:
Notice that the counters along the outside of the square never change order in the sliding
process as long as the red player does not move his/her counter out of the middle.
Therefore, the blue player could never win even if they kept sliding the counters since he
doesn’t have 3 blue counters in a row along the outside. Even if we don’t get to this
exact position for starting to slide, as long as none of the 3 red counters not at the center
are next to each other, the red player will be able to win sometime in the sliding. This is
because at least two of the red counters must have at least two blue between them and
these two will end up opposite when the two blues and the open space are between them.
Can you explain why the red player could still win if he/she chose to play in the bottom
right instead of the bottom middle?
Extension: Some versions of Achi are played with only 3 counters. Is there still always a
winner? Does the first player still have an advantage?
Three-Dimensional Tic-Tac-Toe:
Think of three Tic-Tac-Toe boards stacked one on top of another. (You can draw this by
placing the boards side by side on a piece of paper and thinking of them as top, middle
and bottom.) The goal is still to be the first to get 3-in-a-row, but now the 3-in-a-row can
be on any of the three levels, or between levels. For example, the two pictures below
show 3-in-a-rows that use all three levels.
X
X
X
X
Top
Middle
X
X
Bottom
Top
Middle
Bottom
1) How many different 3-in-a-rows are there?
ANSWER: 49. There are eight 3-in-a-rows on each level, as well as twenty-five 3-in-arows using all three levels. Nine of these are vertical 3-in-a-rows where the spaces are
directly on top of each other. The other sixteen come from taking a 3-in-a-row within
one level and spreading it out between the three levels – for example:
OR
X
X
X
X
X
X
By doing this, we get two 3-in-a-rows from each of the 3-in-a-rows within a level, for a
total of sixteen. This gives the total of 8 + 8 + 8 + 9 + 16 = 49.
2) Can the game end with no winner?
HINT: What would the board look like if the game ended in a draw?
ANSWER: No. The game cannot end in a draw. Suppose it did. Then each of the
boards on each level must end in a draw. There are basically two ways (up to symmetries
and switching X’s and O’s) for a normal game of Tic-Tac-Toe to end in a draw:
X O X
O X O
O X O
and
X O X
O X X
O X O
Now consider a 3D game with each of these as the bottom board. Working with the left
board first, consider the center space in the middle board. It must be either an X or an O.
If it is an O, the middle row on the top board must have Xs on the left and right in order
to avoid 3-in-a-rows between the three levels. Similarly, there must be Xs in the middle
of the bottom row and on the left and right in the top row of the top level.
X O X
O X O
O X O
O
X
X
X
X
X
Then all the other spaces on the top level must be Os in order to block 3-in-a-rows on the
top level.
X O X
O X O
O X O
O
X O X
X O X
O X O
Then the bottom corners of the middle board must be Xs in order to block vertical 3-in-arows. Also the bottom middle of the middle board must be an X to block diagonal 3-in-arows between the levels. But this forces there to be 3 Xs in a row! So we can’t get a
draw this way.
X O X
O X O
O X O
O
X X X
X O X
X O X
O X O
Consider the possibility where we start with the same bottom level and the center square
of the middle level is an X. Then we are forced to have 4 Os in the top level: the center,
top center, and bottom corners.
X O X
O X O
O X O
O
O
X
O
O
Then we are forced to have Xs in the top level top corners, and bottom middle. Also we
must have Xs in the middle level in the top, middle and bottom corners.
X O X
X
X O X
O X O
X
O
O X O
X
X
O X O
But now there are 3 X’s in a row, shown in red: a top corner on the bottom level, the
middle top on the middle level, and the opposite top corner on the top level.
Similarly, if we start with the other base and have an O in the center of the middle board,
we are forced to the following positions:
X O X
X
X
O X X
O X O
O
X O X
O X X
O X O
OO O
O
X
X
X
X
X
X
If instead, we have an X in the center of the middle board, the following moves are
forced:
X O X
O X X
O X O
X O X
O X X
O X O
X
X
XX X
O
O O
O
O
O
O O
O
O
Therefore, there is no way for the game to end in a draw.
3) What are some ways in which you can force a win? Do you have an advantage as the
first or second player?
HINT:
What move would you start the game with?
ANSWER:
Consider the following strategy: As the first player, take the center of the middle
board first. Whatever move the other player makes, you can make a move that requires
the other player to block a 3-in-a-row in a place that cannot be in the same 3-in-a-row as
their first move. Then you can choose a spot which gives you two possible 3-in-a-rows.
Then the other player must block one but you still win – in a total of 7 moves.
For example
1) you move in the center (X)
X
2) the other player moves anywhere (O)
O
X
3) you move so that they have to block you where it won’t give them 2 in the same row
O
X
X
(This is possible since every space other than the center is not in a 3-in-a-row with some
other space – those around the outsides are not in a row with the center square in a
different level and those in the center cannot be used in a 3-in-a-row except within the
level since you already hold the center space.)
4) the other player moves to block you
O
X
X
O
5) you move to have two possible 3-in-a-rows
O
X
X
O
X
(This is possible since you had moved to have two in a row earlier – one of which was
the center - and because of the three levels you can move so you have two potential 3-ina-rows, one within a level and one using the center space.)
6) the other player blocks you
O
O
X
X
O
X
O
X
7) you win
O
O
X
X
X
Another interesting question to explore would be to find the expected length of a game if
players are just playing randomly.
Extensions:
1. Play until all spaces are filled; the winner is the player who has the most 3-in-arows. Can you have a tie? What are winning strategies?
http://www.myparentime.com/games/games44/games44.shtml
2. Play 3-D Tic-Tac-Toe on a 4 x 4 x 4 board, where the winner has to have 4-in-arow. Does there have to be a winner?
3. Play 4-D Tic-Tac-Toe with 9 3 x 3 boards.
http://www.geocities.com/ResearchTriangle/System/3517/tictac4d/tictac4d.html