08 May '04 11:08

A version of the game Nim works as follows: You start with a collection of Skittles (the sweets), and players take it in turns to eat them, according to three rules:

1. You must eat at least one Skittle on your turn.

2. In any turn, all the Skittles you eat must be of the same colour.

3. If you eat the last Skittle, you lose.

Now suppose your opponent is feeling generous, and lets you decide who should go first. Assuming you want to win, how can you determine, given an arbitary collection of Skittles, whether it is better to go first or second?

This is a fairly well-known puzzle, so please don't shout out the answer if you know it already or have found it on the internet, try to work it out.

1. You must eat at least one Skittle on your turn.

2. In any turn, all the Skittles you eat must be of the same colour.

3. If you eat the last Skittle, you lose.

Now suppose your opponent is feeling generous, and lets you decide who should go first. Assuming you want to win, how can you determine, given an arbitary collection of Skittles, whether it is better to go first or second?

This is a fairly well-known puzzle, so please don't shout out the answer if you know it already or have found it on the internet, try to work it out.