Docsity

Strategies for Winning 'Nim Games' - Problem-Solving Seminar by Nathan Carlson, 2007 - Pro, Study notes of Mathematics

Toggle sidebar
bg1
Games!
Nathan Carlson
Problem-solving Seminar, February 14, 2007
It appears that problems of the “game” variety made their appearance on
the Putnam Exam in the early 1990’s and have occured ever since with regular
frequency. Most of these problems are so-called Nim Games, but some do not
fit into any category. In a Nim Game, we consider two players, say Agamem-
non and Br¨umhilde, who make moves alternately. Agamemnon moves first, but
otherwise the rules are the same for both players unless mentioned otherwise.
We let Mrepresent the set of legal moves. If a player finds him/herself in a
position from which no element of Mcan be played then that player loses the
game. We consider games in which no draw is possible and exactly one player
must lose. Furthermore, we assume that positions cannot repeat and that the
set of positions Pis finite.
Given that one player most lose, we can partition the set Pinto the set L
of losing positions and the set Wof winning positions. Thus P=W∪Land
W∩L=∅. A player in a losing position is guaranteed to lose provided his or
her opponent plays correctly. A player in a winning position can force a win no
matter what his or her opponent does.
Observe that to be in a position in Wis to force his/her opponent into a
position in L. To be in a position in Lmeans that the next move must be in
a position in W. From every position in W, a move to a position in Lmust
be possible. Also note that Lmust contain at least one final position ffrom
which no element of Mcan be played. Typically, the problem is to identify the
set Lof losing positions. A useful strategy is as follows: Notice that the set L
is characterized by being the only set of positions satisfing all of the following
conditions. (Why?)
(1) if a position is not in Lthen a move can be made to a position in L.
(2) if a position is in Lthen no move can be made to a position in L.
(3) f∈L.
The strategy lies in identifying a set of positions with the above properties. We
illustrate this strategy with some warm-up examples. Most of the problems b e-
low are adapted from Problem-solving Strategies by Arthur Engel or are taken
from past Putnam Exams.
Example 1. (Bachet’s Game) Initially there are ncheckers on the table. Play-
ers Agamemnon and Br¨umhilde alternate removing icheckers, where i∈M,
the set of legal moves. The winner is the one to take the last checker. Find the
1
pf3

Partial preview of the text

Download Strategies for Winning 'Nim Games' - Problem-Solving Seminar by Nathan Carlson, 2007 - Pro and more Study notes Mathematics in PDF only on Docsity!

Games!

Nathan Carlson

Problem-solving Seminar, February 14, 2007

It appears that problems of the “game” variety made their appearance on the Putnam Exam in the early 1990’s and have occured ever since with regular frequency. Most of these problems are so-called Nim Games, but some do not fit into any category. In a Nim Game, we consider two players, say Agamem- non and Br¨umhilde, who make moves alternately. Agamemnon moves first, but otherwise the rules are the same for both players unless mentioned otherwise. We let M represent the set of legal moves. If a player finds him/herself in a position from which no element of M can be played then that player loses the game. We consider games in which no draw is possible and exactly one player must lose. Furthermore, we assume that positions cannot repeat and that the set of positions P is finite. Given that one player most lose, we can partition the set P into the set L of losing positions and the set W of winning positions. Thus P = W ∪ L and W ∩ L = ∅. A player in a losing position is guaranteed to lose provided his or her opponent plays correctly. A player in a winning position can force a win no matter what his or her opponent does. Observe that to be in a position in W is to force his/her opponent into a position in L. To be in a position in L means that the next move must be in a position in W. From every position in W , a move to a position in L must be possible. Also note that L must contain at least one final position f from which no element of M can be played. Typically, the problem is to identify the set L of losing positions. A useful strategy is as follows: Notice that the set L is characterized by being the only set of positions satisfing all of the following conditions. (Why?) (1) if a position is not in L then a move can be made to a position in L. (2) if a position is in L then no move can be made to a position in L. (3) f ∈ L. The strategy lies in identifying a set of positions with the above properties. We illustrate this strategy with some warm-up examples. Most of the problems be- low are adapted from Problem-solving Strategies by Arthur Engel or are taken from past Putnam Exams.

Example 1. (Bachet’s Game) Initially there are n checkers on the table. Play- ers Agamemnon and Br¨umhilde alternate removing i checkers, where i ∈ M , the set of legal moves. The winner is the one to take the last checker. Find the

set of losing positions if M = { 1 , 2 , 3 ,... , k}, for a positive integer k.

Example 2. The set-up is the same as Bachet’s game, with M = { 2 k^ : k = 0 , 1 , 2 ,.. .}. Find L.

Example 3. The set-up is the same as Bachet’s game, with M = {p : p = 1 or p is prime}. Find L.

Example 4. (1997 Putnam Exam) Players 1, 2 , 3 ,... n are seated around a table, and each has a single penny. Player 1 passes a penny to player 2, who then passes two pennies to player 3. Player 3 then passes one penny to Player 4, who passes two pennies to Player 5, and so on, players alternately passing one penny or two to the next player who still has some pennies. A player who runs out of pennies drops out of the game and leaves the table. Find an infinite set of numbers n for which some player ends up with all n pennies.

Problem 1. The set-up is the same as Bachet’s Game with M = {pk^ : p is a prime and k ∈ Z, k > 0 }. Find L.

Problem 2. (1995 Putnam Exam) A game starts with four heaps of beans, containing 3, 4 , 5, and 6 beans, respectively. Agamemnon and Br¨umhilde move alternately. The set M of legal moves consists of taking either (a) one bean from a heap, provided at least two beans are left behind in that heap, or (b) a complete heap of two or three beans. The player who takes the last heap wins. To win the game, do you want to move first or second? Give a winning strategy.

Problem 3. Initially there is a chip at a corner square of an n × n grid. Agamemnon and Br¨umhilde alternately move the chip one step in any direction in the grid, as long as that square has not already been visited. The loser is the player that cannot move. (a) Who wins for even n? (b) Who wins for odd n? (c) Who wins if the chip starts on a square which is next to a corner square?

Problem 4. This is the game of Double Chess. The rules of chess are changed as follows: White (Agamemnon) and Black (Br¨umhilde) make alternately two legal moves. Show that there exists a strategy for White which guarantees him at least a draw. (There is no need to necessarily demonstrate exactly what this strategy is, nor to be deeply familiar with chess!)

Problem 5. (2002 Putnam Exam) This is the game of Determinant Tic-Tac- Toe. Agamemnon enters a 1 in an empty 3 × 3 matrix. Br¨umhilde replies with a 0 in an empty position. Play continues until the entire 3 ×3 matrix is completed with five 1’s and four 0’s. Br¨umhilde wins if the determinant of the matrix is 0