Game Tree and Nim Strategy

 

Game Tree
This game tree shows all the possible scenarios in a game of 1pile/7peice nim. By following each path you would be able to determine the winning and losing moves within a game of 1pile/7peice nim.

Nim Game Strategies

Nim is a combinatorial game that has different ways to play it. In the following paragraphs you will learn about the strategies we figured out for one, two and three pile nim. Nim is a game that is played with any number of objects which can be coins, stones, sticks, or anything on hand. The players take turns at taking away a number of game pieces and the person to take away the last piece wins.


1 Pile Strategy

The first variation of Nim we would like to talk about is one pile nim. In one pile nim you can only take one or two pieces at a time. This type of game in game theory is called a partial game. In partial games it matters if a player goes first or second. If both players play perfectly in Nim, the first player will always win. In one pile Nim the strategy to win is to divide the number of pieces by 3. After dividing the pieces into groups of three you should have the last group with only one or two pieces. You should take the one or two pieces that are in the group. For this explanation we will start with a pile of thirteen objects, and each player can remove only one or two objects per turn. Since each player can take only one or two objects, the first player wants to keep the pile in a multiple of three. In a pile of thirteen pieces the first player would choose to take one away, making a pile of twelve. If the second player took one on his turn, the first player would take two, to keep the number of pieces in the pile a multiple of three. Or, if the second player were to take two the first would take one. By continuing this pattern it will decrease from twelve to nine to three. When the pieces get down to three you can tell that the winner is player one, because if player two takes one piece player one can take the remaining two pieces and win. If player two were to take two pieces, then player one can take the last one and win.

2 Pile-Strategies
Two pile nim is actually a lot easier to understand and explain than one or three pile Nim, because the main strategy in two pile nim is to keep the piles even. For example, say you have a pile of seven beads and a pile of five beads. If you are the first player you would want to take two beads away from the seven pile beads. Now that you have even piles, you would want to keep the piles even after your opponent plays. Eventually the after your opponent plays he will have taken the last piece in one of the piles. After he or she does that you can take the remaining pieces in the last pile and in the game, then you’ve won!

3 Pile Strategies
Three or more pile strategy
When playing Nim with 3 or more piles, the use of Binary numbers comes into play. You can use the information you get from adding the binary numbers to win at Nim. Click the link to learn Binary Numbers

Link To Binary Numbers

Rules
In games of Nim with three or more piles you can take as many pieces in one pile as possible. The object of the game is to be the person to take the very last piece in the game.

Strategy


First of all, six in binary is 110, four in binary is 100, and three in binary is 11. Unlike two pile Nim, where you try to keep the piles even, in three or more pile Nim you want to keep the binary places even.
In a game of Nim, if you want to win you would want to keep the in the binary digits even. The binary number 11 is the cause of the being odd. So to make them even you want to take one away from the 3rd pile.

Cause of uneven number
Take 1


Now the sum of the binary numbers is 220, by following this pattern until the end of the game you can be sure to win at a game of Nim with 3 or more piles.