3.2

## Weizmann Institute of Science

Skip to 0 minutes and 7 secondsNim is a two-player game The goal of the game is to take the last stone. Whoever takes the last stone, wins. At the beginning of the game, the players decide on the game’s rules, How many piles of stones there are, and how many stones each player is allowed to take from each pile. Let’s take a look at a game of Nim between two players, with one pile of ten stones, and each player can take as many stones as he likes in his turn. Not a very clever game. The first player will always win by taking all the stones in the pile. But suppose there are ten stones in the pile, and each player can take only up to nine stones?

Skip to 1 minute and 0 secondsThe first player can take up to nine stones. Suppose he takes exactly nine stones. Now the second player takes the remaining stone and wins the game. Of course, the first player doesn’t have to take nine stones. He can take less, but that won’t change the outcome of the game. The second player wins, regardless. Let’s change the rules. We’ll still keep one pile for the moment, but this time, each player is allowed to take one, two or three stones, but no more. Can we deduce who will win this game - the first player or the second player? Is there a general way to analyse Nim? Read the article to find out...

# The Game of Nim

Hopefully, you’ve watched the video and now understand what Nim is, but if you still have some questions, you can post them in the comments and we will try and answer as soon as we can. Other learners are invited and encouraged to answer as well!