# Heaps of marbles

Alice and Bob play the following game with two heaps of $10,000$ and $20,000$ marbles.

• Alice and Bob move alternatingly. Alice makes the first move.
• In every move, the active player may
(i) either remove $x\ge1$ marbles from the first heap,
(ii) or remove $y\ge1$ marbles from the second heap,
(iii) or remove $x\ge1$ marbles from the first heap and $y\ge1$ marbles from the second heap, where $x+y$ is divisible by $2016$.
• The player who takes the last marble wins the game.

Question: Which player is going to win this game?
(As usual, we assume that Alice and Bob both use optimal strategies.)

Alice wins

This is how:

Alice first takes $9.112$ marbles from the first heap and $19.112$ from the second heap ($9.112 + 19.112 = 28.224 = 2.016 * 14$), leaving 888 marbles on each heap. From that on she just mirrors Bob's move keeping the heaps equal sized, making it impossible for Bob to win.

• Seems too easy. I wonder if this was close to the intended solution. – Trenin Feb 11 '16 at 12:51
• @Trenin The game is a variation on a game originally proposed by Martin Gardner, where you could not take marbles from both heaps in the same move. This solution is the same, except it makes sure that Bob cannot again de-symmetrize the configuration by taking marbles from both piles simutaneously. Basically, Ivo's solution is to make the problem identical Martin Gardner's, where Alice always wins. – MariusMatutiae Feb 11 '16 at 14:12