# The application of Nimbers to Nim strategy

I've been reading about combinatorial game theory, and some works start with the game of Nim. After that, they introduce Nimbers, which are numbers that represent Nim games. So far so good. I get that, and I understand Nimber addition.

But I don't understand how any of this helps to play Nim.

So I'm interested in knowing how to use Nimbers to play Nim better. Specifically..

1. How do Nimbers represent Nim games?
2. What does Nimber addition mean in the context of Nim?
3. What does Nimber multiplication mean in the context of Nim?

If there's a worked-through example of playing Nim via Nimbers, that would be awesome.

• Have you figured out what multiplication means in the context of Nimbers? Feb 25 '16 at 12:43
• I wrote up a short explanation of nimber theory in reply to Game involving tiling a 1 by n board with 1 x 2 tiles?
– MJD
Jun 9 '20 at 18:31

It's been a while since I've read up on Nimbers (introduced to me by the immortal Martin Gardner), but if I remember correctly, nimbers are basically regular numbers representing the number of stones in a Nim heap. The nimber "sum" is the XOR of the nimbers, and represents a sort of "combined" heap, except that removing stones can either increase or decrease the resulting total nimber, but will always change the total. In particular, since nimbers are always nonnegative, if the total nimber is $0$, there is no place to go but up. Note that the case of all heaps empty has nimber $0$.
So this is the strategy: at the start of your turn, calculate the total nimber. If it is not $0$, determine a change that will make it $0$ and make that move (nim-add each heap to the total you've already calculated (start with the largest heap) and when you find one where the result is less than the heap size, reduce that heap to the result). If the total is $0$, hope and pray that your opponent makes a mistake.
Because it is always possible to reduce a total nimber to $0$ in one move, and since no move will keep a total nimber of $0$ at $0$, as long as you are the one reducing the nimber to $0$, your opponent can't win. They must always move in a way that increases the nimber, meaning that it is never $0$ at the end of their turn. Which means that they cannot reduce all heaps to $0$, since that position has a total nimber of $0$.