100 Rocks: Virtu

There are 100 rocks in a pile. Two players take turns. On each turn, a player may take between 1 and 5 rocks. Whoever takes the last rock wins. Is there a winning strategy?

Answer

The key idea is to identify the losing positions. Since the maximum number of rocks that can be taken in one move is 5, the losing positions are the multiples of 6:

\[ 0,\;6,\;12,\;18,\;\dots \]

For example, if a player is faced with 6 rocks, no matter how many rocks \(x \in \{1,\dots,5\}\) they take, the opponent can respond by taking \(6 - x\) rocks and win.

The largest losing position below 100 is:

\[ 16 \cdot 6 = 96. \]

Therefore, the winning strategy is:

  • On the first move, take \(4\) rocks to leave \(96\).

  • After that, whenever the opponent takes \(x\) rocks, take \(6 - x\) rocks.

By always returning the game to a multiple of 6, you force the opponent into a losing position and guarantee a win.

Back to collection