Puzzles

Two players take turns removing objects from piles. One strategy always wins.

In Nim, players alternate removing any number of objects from a single pile, and whoever takes the last object wins. With several piles at once, is there a reliable way to know whether you're in a winning or losing position?

Reveal the answer

Yes: convert every pile's size to binary and XOR them all together (add each column without carrying, mod 2). If the result is anything other than zero, the position is a win for whoever moves next, and there's always a move that forces the total back to zero. Charles Bouton proved this completely in 1901, founding the mathematical theory of combinatorial games.

Charles L. Bouton, Nim, A Game with a Complete Mathematical Theory — Annals of Mathematics, 1901

One credited idea per card. No filler. Swipe the rest in Savvy.

Keep swiping — it's free Works right in your browser. No app store needed.