Home > Riddles > Nim (3,4,5) in modo misère

Nim (3,4,5) in modo misère

Master playsLevel 3/5

Nim (3,4,5) in misère mode works when the reader accepts a simple rule and follows it to the end without losing the thread. That's where the beautiful part appears: in the clarity of the mechanism.

There are three piles with 3, 4 and 5 chips. On each turn you can withdraw any positive number of tokens, but from a single pile.

It is played in misère mode: whoever takes the last piece loses. Does the first player have a winning strategy?

If you have it, what is your first move?

Hints

Show hints
  1. Almost all Nim is solved with XOR, but the misère ending forces you to look carefully at small cases.
  2. Start by checking if the initial position is N or P using nim-sum.
  3. The first good move leaves the opponent in a position with nim-sum 0 without yet falling into the pathological ending of all ones.

Solution

Show full solution

Answer: Yes, the first player wins. The first correct move is to go from $(3,4,5)$ to $(1,4,5)$ (remove 2 from the pile of 3). Initial XOR calculation:

$$ 3\oplus4\oplus5=2\neq0. $$ Since we are not in the “all 1” phase, in misère it is played like normal Nim: you have to leave XOR 0. With $s=2$: - $3\oplus2=1<3$ (valid), - $4\oplus2=6>4$, - $5\oplus2=7>5$. The only play that leaves XOR 0 is reducing 3 to 1. **Misère closure:** when at the end there are only piles of size 1 left, it is adjusted to leave an odd number of piles to the rival. $$

Related riddles

Keep practicing

If you enjoyed this one, try more pure-logic riddles, explore this theme, browse the full archive, or read the riddle-solving guide.

← Previous: The combined weight lift · Next: The envious dice →