Handout Combinatorial Games Solutions
Handout Combinatorial Games Solutions
Review Problems
1. Two players alternately draw diagonals between vertices of a regular polygon. They may connect two vertices
if they are non-adjacent and if the diagonal formed does not cross any of the previous diagonals formed. The last
player to draw a diagonal wins.
(a) Who has a winning strategy if the polygon is a pentagon?
(b) Who has a winning strategy if the polygon is a hexagon?
(c) Who has a winning strategy if the polygon has 1000 vertices?
(d) Who has a winning strategy if the polygon has 2015 vertices?
Solution: In (a), the game is forced to end after 2 moves, so the second player wins.
In (b) and (c), and indeed in any even-sized polygon, the first player can win by drawing the longest possible
diagonal on his first move, splitting the polygon into two equal pieces. Then, since no further moves can cross that
initial diagonal, all future moves must be on one side or the other, so the first player can simply copy the second
player’s moves, but on the opposite side. Thus the first player is always guaranteed a move, and hence will
win.
But there is no obvious symmetry strategy to take advantage of in part (d).
As it turns out, strategy is not necessary. We claim that for a regular polygon with n sides, n ≥ 4, the game always
lasts exactly n − 3 moves. We prove this by strong induction.
For the base case n = 4, drawing either diagonal results in a position where no more moves are possible, so the
result holds.
For the inductive step, assume that the result holds for all 4 ≤ n ≤ k, for some positive integer k ≥ 4, and consider
a regular polygon with k + 1 vertices. Drawing any diagonal splits the polygon into two polygons with a vertices and
b vertices, where a + b = k + 3. Also, a ≤ k and b ≤ k, so by the induction hypothesis, the polygon with a vertices is
exhausted after a − 3 diagonals have been drawn, and the polygon with b vertices is exhausted after b − 3 diagonals
have been drawn, for a total of (a − 3) + (b − 3) + 1 = a + b − 5 = k − 2 = (k + 1) − 3 moves. Hence, the result holds
for n = k + 1, and by strong induction, the result holds for all n ≥ 4.
In particular, if n is even, then the first player always wins (no matter what moves he makes), and if n is odd, then
the second player always wins (no matter what moves he makes).
2. A pile starts with N chips. Two players take turns removing a number of chips from the pile, where the choices
for the number removed is as specified below. The player who takes the last chip wins.
(a) Determine the values of N for which the first player has a winning strategy if 1, 2, or 6 chips may be removed
each turn.
(b) Determine the values of N for which the first player has a winning strategy if the number of chips removed
each turn must be a power of 2 (including 1).
Solution:
(a) We make a chart of winning and losing positions for small values of N :
N 0 1 2 3 4 5 6 7 8 9 10
L W W L W W W L W W L
Seeing the pattern start to repeat at N = 7, we might guess that the winning and losing positions are determined
by the modulo-7 residue of N . Specifically, we claim that N stones is losing if N ≡ 0, 3 (mod 7) and winning if
N ≡ 1, 2, 4, 5, 6 (mod 7).
For the second part, here are the losing positions, and we verify that all moves lead to winning positions:
(b) We claim the winning positions are the positions that are not multiples of 3, and the losing positions are
multiples of 3. Indeed, if the number of stones is 1 or 2 (mod 3), then we remove 1 or 2 stones (respectively) to
move to a (losing) multiple of 3; conversely, if the number of stones is a mutliple of 3, then since no power of 2 is
also a multiple of 3, we must move to a (winning) non-multiple of 3.
3. Consider the following game played with a deck of 2n cards numbered from 1 to 2n. The deck is randomly
shuffled and n cards are dealt to each of two players. Beginning with A, the players take turns discarding one of
their remaining cards and announcing its number. The game ends as soon as the sum of the numbers on the
discarded cards is divisible by 2n + 1. The last person to discard wins the game. Assuming optimal strategy by
both A and B, what is the probability that A wins?
Source: Putnam
Solution: The probability is 0: regardless of the initial shuffle, player B has a winning strategy. Notice that since the
entire deck is dealt, both players know at all times what cards the other player has, so they have perfect
information.
Player A clearly cannot win on the first move. Suppose it is player B’s move and the sum of the cards played so far
is s, and A’s cards are a1 , a2 , . . . , ak for some k. Then B knows that he has to avoid playing a card among
−(s + a1 ), −(s + a2 ), . . . , −(s + ak ) (mod 2n + 1), because if he plays −(s + aj ) then A could play aj and make the
sum 0 (mod 2n + 1).
This means that there are k cards that B has to avoid playing on his turn. But B has k + 1 cards in his hand (he
always has one more card than A does when it’s B’s turn, since A was forced to play first), and all the cards in the
game have distinct values modulo 2n + 1. Thus B can always avoid playing a card that will permit A to win.
Therefore, A cannot win. But the game must end since there are a finite number of cards, and if they make it all the
way to the end, the sum will be 1 + · · · + 2n = n(2n + 1), which is a win for B. So B can always win, regardless of
the initial shuffle.
4. Generalize Problem 3.2 to starting with n stones. Determine (in terms of n) which player has a winning
strategy.
Solution: We already determined that an even number of stones is a winning position.
Challenge Problems
5. Let k be a positive integer. Two players A and B play a game on an infinite grid of regular hexagons (as shown
below). Initially all the grid cells are empty. The players alternately take turns with A moving first. On his move, A
chooses two adjacent hexagons in the grid that are empty and places a counter in both of them. On his move, B
chooses any counter on the board and removes it. If at any time immediately after A’s move, there are k
consecutive adjacent grid cells in a line all of which contain a counter, A wins. Find the minimum value of k for
which A cannot guarantee a win in a finite number of moves, or prove that no such minimum value exists.
Source: USAMO/USAJMO
Solution: The answer is k = 6. We show that B can prevent A from getting 6-in-a-row. Color some of the hexagons
gray as in the picture below:
Player A cannot play on two shaded cells in the same move, so B’s strategy is to always remove a counter from a
shaded cell. Since any 6-in-a-row line contains exactly 2 shaded cells, but A can only have at most one counter on a
shaded cell (immediately after his move, before B has a chance to remove it), A cannot win.
We show that A can get 5 counters in a row. Player A can trivially get 4 counters in a row after his third move (the
key is that A’s second move should result in counters on three mutually-adjacent hexagons):
If B does not remove one of the middle counters, then A can win immediately on his next move. Otherwise (up to
symmetry) A can move to create this position:
Again, if B does not remove one of the middle counters from the 4-in-a-row line, then A can win immediately on his
next move. Otherwise, A can replace the removed counter and place another adjacent counter, like so (up to
symmetry):
Once again, if B does not remove one of the middle counters from the 4-in-a-row line, then A can win immediately
on his next move. If B removes the top middle counter, then A can respond as follows:
Now B cannot prevent A from making a vertical line of 5-in-a-row on his next turn.
If on the previous turn, B removes the bottom middle counter, then A can respond as follows:
Once again, if B does not remove one of the middle counters from the 4-in-a-row line, then A can win immediately
on his next move. If B removes the bottom middle counter from the 4-in-a-row line, then A can make two 4-in-a-row
vertical lines, and then win on his next move. If B removes the top middle counter from the 4-in-a-row line, then A
responds as follows:
Now A has two 5-in-a-row vertical lines with a single counter missing. B can only remove a counter from one of the
lines, so A plays to fill the other line’s missing counter to win on his next move.
6. Four heaps contain 38, 45, 61, and 70 matches respectively. Two players take turns choosing any two of the
heaps and removing a non-zero number of matches from each heap (not necessarily the same number from each).
The player who cannot make a move loses. Which one of the players has a winning strategy?
Source: Baltic Way
Solution: Having only 2 or 3 heaps is clearly a win for the current player: that player simply removes two of the
heaps altogether.
Denote a 4-heap position as (w, x, y, z) with 0 < w ≤ x ≤ y ≤ z the sizes of the heaps. We claim that the winning
positions are those with w < y, and conversely the losing positions are those with w = x = y.
If w < y, then y − w and z − w matches can be removed from the y and z heaps (respectively), to leave the position
(w, w, w, x), which is losing.
On the other hand, if w = y, so that the position is (w, w, w, z), then there are only three cases of moves:
• two of the w-heaps can be reduced to 0 < w′ ≤ w′′ < w, leaving the 4 heaps (w′ , w′′ , w, z), a winning position;
or
• a w-heap can be reduced to 0 < w′ < w and the z-heap can be reduced to 0 < z ′ < z. This leaves one of the
4-heap positions (w′ , w, w, z ′ ) or (w′ , z ′ , w, w) or (z ′ , w′ , w, w) depending on the size of z ′ , but in all of these
cases the second-largest heap is strictly bigger than the smallest heap, a winning position; or
• a heap (or two) get removed entirely, leaving a winning position.
All winning positions can move to losing positions (or win the game immediately if there are fewer than 4 heaps),
and all losing positions must move to winning positions, so this proves our claim.
The starting position of (38, 45, 61, 70) is winning. The initial winning move is to remove 23 from the pile of 61 and
32 from the pile of 70, leaving (38, 38, 38, 45). (One could instead remove matches from any two of the three largest