510 Combinatorial games
17.3 The gameNim ......................
Given three piles of marbles, witha,b,cmarbles respectively, players
AandBalternately remove a positive amount of marbles from any pile.
The player who makes the last move wins.
Theorem 17.4.In the game nim, the player who can balance the nim
sum equation has a winning strategy.
Therefore, provided that the initial position(a, b, c)does not satisfy
abc =0, the first player has a winning strategy. For example,
suppose the initial position is(12, 7 ,9). Since 12 9=5, the first
player can remove 2 marbles from the second pile to maintain a balance
of the nim sum equation,
12 5 9=0
thereby securing a winning position.
This theorem indeed generalizes to an arbitrary number of piles.