1901 · Charles Bouton · Harvard

Nim

Take the last stone. Win.

Pile 1 (5)
Pile 2 (4)
Pile 3 (3)

The Paper

In 1901, a Harvard mathematician named Charles Bouton published a paper in the Annals of Mathematics titled simply “Nim, a game with a complete mathematical theory.”

The title wasn’t modest. It was accurate. Bouton didn’t just find a good strategy — he completely solved the game. Meaning: given any position, you can calculate the optimal move in seconds. There’s no luck, no gut feel, no experience required. Just arithmetic.

This was the first time anyone had done this for a game. Game theory as a field wouldn’t exist for another forty years — von Neumann and Morgenstern wouldn’t publish their foundational work until 1944. Bouton got there first, in 1901, with Nim.

The game itself is older — variations appear in Chinese and European literature from the 1600s. But Bouton was the first to prove, mathematically, exactly who wins and why.

Bouton, C. L. (1901). Nim, a game with a complete mathematical theory. Annals of Mathematics, 3(1/4), 35–39.

The Secret

How to beat Hard mode — and why it works.

Step 1: Write each pile in binary

Take the starting position: piles of 5, 4, and 3. Write each as a binary number:

5

1 0 1

4

1 0 0

3

0 1 1

Step 2: XOR them together (the nim-sum)

XOR each column — 1 if an odd number of 1s, 0 if even. This gives the nim-sum.

1 0 1 (5)

1 0 0 (4)

0 1 1 (3)

0 1 0 = 2 ← nim-sum

Step 3: The rule

nim-sum ≠ 0 → you’re in a winning position

There exists a move that reduces the nim-sum to 0. Find it. Your opponent can’t avoid losing.

nim-sum = 0 → you’re in a losing position

Every move you make will create a non-zero nim-sum, giving your opponent a winning move. Pray they don’t know the secret.

Try it

Enter any pile sizes and see the nim-sum live. If it’s non-zero, a winning move exists.

0101

0100

0011

0101 XOR 0100 XOR 0011

nim-sum = 2

✓ Winning position — a perfect move exists

Now go back and try Hard mode. The AI knows this secret — but so do you. Set up a position where the nim-sum is already 0 before your first move, and the AI is in a losing position from the start.


More Games from Old Papers

Each of these games was invented or described in an academic paper. Each has a surprising story.

Chomp

1970s

The winning strategy is proven to exist — but nobody knows what it is.

Coming soon

Hex

1948

John Nash invented it at Princeton. On toilet paper.

Coming soon

Dots & Boxes

1889

Édouard Lucas published it as a children’s game. It’s secretly brutal.

Coming soon