WOLFRAM|DEMONSTRATIONS PROJECT

The Secret of Nim

​
heap sizes
1
1
2
3
3
5
4
7
heap 1
1
{0,0,0,1}
⊕
{0,0,0,0}
{0,0,0,1}
1
⊕
heap 2
3
{0,0,1,1}
⊕
{0,0,0,0}
{0,0,1,1}
3
⊕
heap 3
5
{0,1,0,1}
⊕
{0,0,0,0}
{0,1,0,1}
5
⊕
heap 4
7
{0,1,1,1}
⊕
{0,0,0,0}
{0,1,1,1}
7
nim-value
0
{0,0,0,0}
​
​
​
​
​
​
h 1
h 2
h 3
h 4
​
​
Explore the mathematical background of the game of Nim and learn how to play the optimal strategy.