# Nim Games – Lesson Plan

## Counting to 20

Here is a counting game to try with a partner.

• The object of the game is to be the first one to say "20".
• The first person must start at "1".
• Each person may say one, two, or three numbers per turn, and the numbers must be in counting order. Each person must start with the number after the last one that the other person said.
• For example, the first person can say "1", or "1, 2", or "1, 2, 3."
• If the first person says "1, 2", then the second person could say "3" or "3, 4", or "3, 4, 5".
• Whoever says "20" wins the game.
• Play this game many times and try to discover a winning strategy.

## Counting to 21

As in the previous game, players alternate saying one, two, or three numbers per turn. This time, the one who says "21" wins the game. What is the winning strategy now? Is it better to go first or second?

## Counting to 22, 23, 24, 25, 26, 27, and 28

Players alternate saying one, two, or three numbers per turn. Determine the strategy if the goal number changes to 22, 23, 24, 25, 26, 27, or 28. When is it better to go first? When is it better to go second? How can you describe the winning numbers in each case?

## Counting to 400

Players alternate saying one, two, or three numbers per turn. What if the goal number changes to 400? Is it better to go first or second? How could you describe the winning numbers?

## Counting to 8,132

Players alternate saying one, two, or three numbers per turn. What if the goal number changes to 8,132? Is it better to go first or second? How could you describe the winning numbers?

## Counting to 8,133

Players alternate saying one, two, or three numbers per turn. What if the goal number changes to 8,133? Is it better to go first or second? How could you describe the winning numbers?

In this variation, players take turns adding numbers between 1 and 10 to the previous total. The first player chooses a number between 1 and 10 to start with. The second player adds any number between 1 and 10 and gives the new total. (It is best if the players say what they are adding and the sum). The two players alternate until one of them reaches 100. Whoever gets to 100 wins. This number is great mental addition practice and is also a challenging version of the basic counting game. Steve Dingledine introduces this game at the beginning of the school year, and plays it intermittently all year. At the end of the year, he helps students analyze the game to find the winning strategy.

• A hint about the strategy is that there are winning numbers that will guarantee you a win if you say them and don't make a mistake later.
• It can help to write all of the numbers from 1 to the ending number and then circle the winning numbers.
• The winning numbers for the original counting to 20 game are 4, 8, 12, 16, and 20 itself. It is usually easiest to discover that 16 is a winning number first and then work backwards to find the rest. Students should note that we can find these numbers either by moving four numbers backwards each time or by repeatedly subtracting four (starting with 20). Older students may note that these numbers are all multiples of four or that these numbers have a remainder of 0 when they are divided by four.
• In addition to finding the winning numbers, it is necessary to decide whether it is better to go first or second. For the original counting to 20 game, 4 is the first winning number and so it is better to go second so that you can be the one to say that number.
• For the counting to 21 game, the winning numbers are 1, 5, 9, 13, 17, and 21 itself. Students should note that we can find these numbers by moving four numbers backwards each time or by repeatedly subtracting four (starting with 21). Older students may note that these numbers are one more than the multiples of four or that these numbers have a remainder of 1 when they are divided by four.
• For the counting to 21 game, since the lowest winning number is 1, it is best to go first and say "1".
• For the counting to 22 game, the winning numbers are those numbers that have a remainder of 2 when they are divided by four. It is best to go first and say "1, 2".
• Here is the general strategy for games when each player says 1, 2, or 3 numbers on each turn. Find the remainder of the goal number when it is divided by four. The winning numbers always have the same remainder as the goal number when divided by four. It is better to go first if the goal number is not a multiple of four. It is better to go second if the goal number is a multiple of four.
• When each player says 1 or 2 numbers per turn, the winning numbers are spaced three numbers apart. This means that the winning numbers always have the same remainder as the goal number when both are divided by three. It is better to go first if the goal number is not a multiple of three. It is better to go second if the goal number is a multiple of three.
• As students discover winning strategies, they should record their results in writing. Younger students might do this by formulating their conclusions as a group while the teacher records the words. Older students can work in groups, pairs, or individually to write their conclusions.

# Nim Games

For each of the games below, two players alternate turns. Unless indicated otherwise, the winner is the last player who makes a legal move. See if you can find a winning strategy including when it is better to go first or second. Try to prove that your strategy works.

Counting to 18.
Two players alternate counting starting with one. Each player must pick up counting where the previous player left off. Players must say one or two numbers on their turn. The player who says 18 wins the game.
Counting to 19.
Change the rules for the previous game so that the player who says 19 wins the game. Players must still say one or or two numbers per turn.
Counting to 20.
Change the rules for the previous game so that the player who says 20 wins the game. Players must still say one or two numbers per turn.
Counting to 3027.
Change the rules for the previous game so that whoever says 3027 wins the game.
Removing Pennies.
A set of 16 pennies is placed on a table. Two players take turns removing pennies. At each turn, a player may remove between one and four pennies (inclusive).
Removing More Pennies.
Change the rules for the previous game so that a set of 1,062 pennies is placed on a table. At each turn, a player may remove between one and three pennies (inclusive).
Don't Remove The Last Penny.
What if the first Removing Pennies game was changed so that the loser is the player who takes the last penny.
Breaking Chocolate.
Start with a rectangular chocolate bar which is 6 x 8 squares in size. A legal move is breaking a piece of chocolate along a single straight line bounded by the squares and eating one of the pieces. Whoever eats the last square wins.
Cartesian Chase.
Begin by creating a rectangular grid with a fixed number of rows and columns. The first player begins by placing a mark in the bottom left square. On each turn, a player may place a new mark directly above, directly to the right of, or diagonally above and to the right of the last mark placed by the opponent. Play continues in this fashion, and the winner is the player who places a mark in the upper right hand corner first.
The Asymmetric Rook.
On some starting square of an 8 x 8 chessboard there is an "asymmetric rook" that can move either to the left or down through any number of squares. Alice and Bob take turns moving the rook. The player unable to move the rook loses.
Match Pile.
There are 25 matches in a pile. A player can take 1, 2, or 4 matches at each turn. Whoever removes the last match wins.
Two Match Piles.
There are two piles of matches; one pile contains 10 matches and the other contains 7. A player can take one match from the first pile, or one match from the second pile, or one match from each of the two piles. Whoever takes the last match wins.
Writing a 20-digit Number.
Alice and Bob produce a 20-digit number, writing one digit at a time from left to right. Alice wins if the number they get is not divisible by 3; Bob wins if the number is divisible by 3.
Writing another 20-digit Number.
What if the 3 in the previous game is replaced by 15?
Diagonals in a Polygon.
Given a convex n-gon, players take turns drawing diagonals that do not intersect those diagonals that have already been drawn. The player unable to draw a diagonal loses.
Reducing by Divisors.
At the start of the game, the number 60 is written on the paper. At each turn, a player can reduce the last number written by any of its positive divisors. If the resulting number is a 0, the player loses.
Multiplying to 1000.
Alice calls out any integer between 2 and 9, Bob multiplies it by any integer between 2 and 9, then Alice multiplies the new number by any integer between 2 and 9, and so on. The player who first gets a number bigger than 1000 wins.
Squares and Circles.
In this game, one person plays Squares and the other person plays Circles. Start with an initial row of circles and squares. On each turn, a player can either replace two adjacent squares with a square, replace two adjacent circles with a square, or replace a circle and a square with a circle. The Squares player wins if the last shape is a square and the Circles player wins if the last shape is a circle.
Negative to Positive.
There are a number of minuses written in a long line. A player replaces either one minus by a plus or two adjacent minuses by two pluses. The player who replaces the last minus wins.
A Circle of Negativity.
Same game as above except that the minuses are written around a circle.
Number Cards.
There are nine cards on a table labeled by numbers 1 through 9. Alice and Bob take turns choosing one card. The first player who acquires three cards that total 15 wins.
Puppies and Kittens.
Start with 7 kittens and 10 puppies in the animal shelter. A legal move is to adopt any positive number of puppies (but no kittens), to adopt any positive number of kittens (but no puppies), or to adopt an equal number of both puppies and kittens. Whoever adopts the last pet wins.
Splitting Stacks.
A game is played with two players and an initial stack of n pennies (n ≥ 3). The players take turns choosing one of the stacks of pennies on the table and splitting it into two stacks. When a player makes a move that causes all the stacks to be of height 1 or 2 at the end of his or her turn, that player wins. Which starting values of n are wins for each player?
The Rolling Die.
Start by rolling a six-sided die and choose a goal number (31 for example). On their turns, players turn the die to any adjacent side and add the result to the die. A player may not repeat the number already up and may not flip the die 180 degrees to get the opposite number. The player who either attains the goal number or forces their opponent over the goal number wins.
Nim.
Start with several piles of stones. A legal move consists of removing one or more stones from any one pile. The person who removes the last stone wins.
1. What happens if there is only one pile?
2. If the game has only two piles, what is the winning strategy?
3. What if the game starts with three piles of 17, 11, and 8 stones?
4. What is the general strategy for winning Nim games no matter how many piles there are?
Riverbend Community Math Center
hello@riverbendmath.org
http://riverbendmath.org
(574) 339-9111
This work placed into the public domain by the Riverbend Community Math Center.