The game of nim is played with two players againts each other ,by removing 1 or many stones from only one pile in each turn from n piles each pile with $n_1,...,n_k$ and a player cannot skip a turn. The game is determined to be winning or losing for a first player and otherway around for another player from the starting to the end of the game given the both plays optimally.
XOR the number of stones in the pile
- Not equal to zero then the first player win
- Equal to zero the the first player will lose
But I don't see the intuation behind the XOR being used here.
For example in a simple game with one pile of N stone and we can only take 1,2,3 stones in one move,the player to take the last stone(s) wins. The winning and the losing states kinda seems intuative, $$0 - Lose, 1 - win, 2 - lose, 3 - win, 4 - lose, 5 - win, 6 - win, 7 - win, 8 - lose ..$$ Althought the states in the nim game are clearly defined with the XOR operation but the ldea of using it here seems not that intuative.