MindYourPuzzleMindYourPuzzle
Insight · ★★★☆☆ · ~7 min

Nim

Piles of stones, take the last to win. There's a binary trick to never lose.

by MindYourPuzzle

A 4,000-year-old game with a solution that looks like magic until you see the binary.

Two players face several piles of stones — say piles of 3, 5, and 6. Players alternate turns. On your turn you remove any number of stones (at least one) from a single pile. The player who takes the last stone wins.

Both play perfectly.

From the starting position (3, 5, 6), is it a win for the player who moves FIRST, or the player who moves SECOND?

(Answer "first" or "second".)

Hints