0% found this document useful (0 votes)
352 views7 pages

Handout Combinatorial Games Solutions

Uploaded by

lcm.jimenez.pers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
352 views7 pages

Handout Combinatorial Games Solutions

Uploaded by

lcm.jimenez.pers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

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).

© 2023 AoPS Incorporated 1


Combinatorial Games Solutions
As usual, to prove this claim, we must show that there exists a move from each winning position to each losing
position, and that all moves from losing positions lead to winning positions.
For the first part, here are the winning positions and the move we can make to go to a losing position:

Start (mod 7) Move Finish (mod 7)


1 1 0
2 2 0
4 1 3
5 2 3
6 6 0

For the second part, here are the losing positions, and we verify that all moves lead to winning positions:

Start (mod 7) Move Finish (mod 7)


0 1 6
0 2 5
0 6 1
3 1 2
3 2 1
3 6 4

(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.

© 2023 AoPS Incorporated 2


Combinatorial Games Solutions
If there are 2m + 1 stones in the pile (for some m), then the current player knows that taking 1 stone is definitely a
losing move (leaving the winning position of 2m stones for the other player), so his only hope is to take m stones
and leave m + 1 stones. If this is even, then this is still winning for the other player. Therefore, 2m + 1 stones, where
m is odd, is a losing position.
Next we consider 4m + 1 stones where m is odd. The current player can remove 2m stones, leaving the losing
position of 2m + 1 stones for the other player. So 4m + 1 stones is a winning position.
Similarly, 8m + 1 stones (with m odd) is losing, 16m + 1 stones is winning, and so on.
The general statement is that the position is winning for the current player if and only if the number of stones is of
the form 2k m + 1, where k is an even integer and m is odd. (The case of k = 0 covers the situations in which the
number of stones is even.) Conversely, the losing positions are of the form 2k m + 1, where k is an odd integer and
m is odd. The proof is via a straightforward induction, the details of which we will leave to you to fill in.

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):

© 2023 AoPS Incorporated 3


Combinatorial Games Solutions

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:

© 2023 AoPS Incorporated 4


Combinatorial Games Solutions

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

© 2023 AoPS Incorporated 5


Combinatorial Games Solutions
heaps to leave (38, 38, 38, n) where n ∈ {45, 61, 70}.)
7. Two piles contain 28 and 35 chips. Two players take turns, and on each turn the player may remove any
number of chips from a single pile, or the same number of chips from both piles. The player who takes the last chip
wins. Which player has a winning strategy, and what is that strategy?
Solution: Let (a, b) denote the position in the game where there are a chips in one pile and b chips in the other pile,
with a ≤ b. Note right away that (0, 0) is the “trivial” losing position, and that for any a > 0, the positions (0, a) and
(a, a) are 1-move wins.
The smallest non-trivial losing position is (1, 2), because the only moves are to (0, 1) or (0, 2) or (1, 1), which are all
winning for the other player. Thus, any position (1, a) with a > 2 is winning, because the player can remove a − 2
chips the from larger pile, leaving the losing position (1, 2). Similarly, any position (2, a) with a > 2 is winning,
because the player can remove a − 1 chips from the larger pile, leaving the losing position (1, 2). Finally, any
position (a, a + 1) with a > 1 is winning, because the player can remove a − 1 chips from both piles, leaving the
losing position (1, 2).
So any position in which a pile has 1 or 2 chips, except for (1, 2), is winning, as is any position except for (1, 2) in
which the number of chips differ by 1. We look for a candidate for the next largest losing position. This is (3, 5): the
number of chips exceed 2 in each pile, and the difference exceeds 1. This is losing, because any move either
creates a pile of 2 or less, or a difference of 1 or less, which is a win for the other player.
Now any larger position with a 3-chip pile or a 5-chip pile is winning, as in any larger position with a 2-chip
difference, because it can be moved to (3, 5).
The next smallest losing position is (4, 7), where both piles contain a number of chips not in any previous losing
position, and the difference in the number of chips is larger than any previously-considered difference. This leads
to the winning positions (4, n), (7, n) and (m, m + 3) for any larger n or m.
These examples lead to a recursive method to determine the losing positions (xn , yn ). We already have
(x1 , y1 ) = (1, 2), (x2 , y2 ) = (3, 5), and (x3 , y3 ) = (4, 7). We recursively define xn to be the smallest positive integer
that does not occur as xi or yi for any 1 ≤ i < n, and then yn = xn + n. This gives the following chart of losing
positions:
n 1 2 3 4 5 6 7 8 9 10
xn 1 3 4 6 8 9 11 12 14 16
yn 2 5 7 10 13 15 18 20 23 26
Note that every positive integer will appear as exactly one xn or yn .
To solve our given game: the position (28, 35) can be moved to the losing position (11, 18) by removing 17 chips
from each pile, so it is a win for the first player.
Note: This game is known as Wythoff’s Nim.

© 2023 AoPS Incorporated 6


Art of Problem Solving is an ACS WASC Accredited School.
Thanks to our sponsors:

You might also like