Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 37s1 days 16 hours 1 minutes 37 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 37s1 days 16 hours 1 minutes 37 seconds.

Sign in to watch this lesson
Advanced - Combinatorics, Games and Puzzles · 4:40
In Nim, players take any number of tokens from one pile, and whoever takes the last token wins. After labelling winning and losing positions from the bottom up in a simple take-away game, we prove Bouton's theorem: the player to move loses exactly when the xor of the pile sizes is zero, and the winning move turns a pile x into x xor s. We finish with the misère version, where the last token loses, and two interview traps: the parity of the total and staircase Nim.