Let and be positive integers. Cathy is playing the following game. There are marbles and boxes, with the marbles labelled to . Initially, all marbles are placed inside one box. Each turn, Cathy chooses a box and then moves the marbles with the smallest label, say , to either any empty box or the box containing marble . Cathy wins if at any point there is a box containing only marble .
Determine all pairs of integers such that Cathy can win this game.
Solution
We claim Cathy can win if and only if .
First, note that each non-empty box always contains a consecutive sequence of labeled marbles. This is true since Cathy is always either removing from or placing in the lowest marble in a box. As a consequence, every move made is reversible.
Next, we prove by induction that Cathy can win if . The base case of is trivial. Assume a victory can be obtained for boxes and marbles. Consider the case of boxes and marbles. Cathy can first perform a sequence of moves so that only marbles are left in the starting box, while keeping one box, say , empty. Now move the marble to box , then reverse all of the initial moves while treating as the starting box. At the end of that, we will have marbles in the starting box, marbles in box , and empty boxes. By repeating the original sequence of moves on marbles , using the boxes that are not box , we can reach a state where only marble remains in the starting box. Therefore
a victory is possible if or smaller.
We now prove by induction that Cathy loses if . The base case of and is trivial. Assume a victory is impossible for boxes and marbles. For the sake of contradiction, suppose that victory is possible for boxes and marbles. In a winning sequence of moves, consider the last time a marble leaves the starting box, call this move . After , there cannot be a time when marbles are all in the same box. Otherwise, by reversing these moves after and deleting marbles greater than , it gives us a winning sequence of moves for marbles and boxes (as the original starting box is not used here), contradicting the inductive hypothesis. Hence starting from , marbles will never be in the same box as any marbles greater than or equal to .
Now delete marbles and consider the winning moves starting from . Marble would only move from one empty box to another, while blocking other marbles from entering its box. Thus we effectively have a sequence of moves for marbles, while only able to use boxes. This again contradicts the inductive hypothesis. Therefore, a victory is not possible if or greater.