NIM ZERO · 2026.09.20-v2
What is nim-sum? XOR explained with 3–5–7
The nim-sum is the bit-by-bit exclusive-or (XOR) of every heap count. It is zero when each binary column contains an even number of 1s. In ordinary Classic Nim, zero is the balanced state you want to leave to the opponent.
Calculate the XOR
Write 3, 5, and 7 as 011, 101, and 111. XOR evaluates each column independently: 0⊕1⊕1 = 0, 1⊕0⊕1 = 0, and 1⊕1⊕1 = 1. The nim-sum is therefore 001, or 1.
Make the value zero
Reduce the heap of 7 to 6. Its binary row becomes 110, and 011 XOR 101 XOR 110 equals 000. The move takes one piece and passes a balanced position to the opponent.
Try a move and test the XOR
Predict the starting nim-sum, choose one heap and remove pieces. The result is checked by the same Classic Nim engine as the game. This exercise explains a move; it is not a Daily attempt.
Retry this starting position in the game (Assisted)Classic Nim only: Misère endings and Take-away 21 use different rules.
Worked position
| Heap | Binary | 10 |
|---|---|---|
| 1 | 011 | 3 |
| 2 | 101 | 5 |
| 3 | 111 → 110 | 7 → 6 |
| nim-sum | 001 → 000 | 1 → 0 |
Method and source
Method: finite legal moves are exhaustively checked by Nim Zero’s pure rules engine. Mathematical source: C. L. Bouton, “Nim, A Game with a Complete Mathematical Theory,” Annals of Mathematics, Second Series 3, no. 1/4 (1901–1902), 35–39.
DOI: 10.2307/1967631 · 2026-09-20