Nim: the game invented before computers

Piles of counters sat on tables long before the first processor. The mathematician Charles Bouton analysed Nim back in 1901: he showed that every position has an exact score, the nim-sum. Numbers decide whether it wins or loses, not gut feeling. I opened the game and wondered what it feels like to sit across from a truth table.

Gameplay screenshot: Nim

What Bouton Counted

The rule looks childish: take as many counters as you want per move, but from one pile. Whoever takes the last one wins. Inside sits arithmetic without mercy. The AI on the site plays the same optimal strategy: it holds a zero nim-sum position and waits for your mistake.

Click a counter and you take as many pieces as its place from the bottom. One click, and the position is recalculated. In my first game I took three counters from the middle pile instead of two. The machine answered with a move after which my chances evaporated. No gloating animation, nothing. Just a new layout.

Where I Broke

A losing starting position leaves the first player no chance against exact play. The description says it straight: going second only loses from a losing start. So sometimes you are doomed before the first click and learn it last.

That hooked me. Usually a game flatters you: everything is in your hands, they say. Here the board is honest from the start. Move by move I learned to see piles with arithmetic: where the extra counter sits, which move levels the position.

The Demo as a Lecture

There is a mode where the AI plays itself. You watch and see a textbook in motion: machine against machine, not one wasted move. I replayed such a game twice, and on the third try I finally beat the computer myself. I took the last counter and sat staring at the empty board.

Century-old mathematics against my evening. The evening won one to nil.

Take on the nim-sum in the Nim game

INFO
[Partner ads]

We use cook​ies for analytics. Click "OK" to consent.

Details