Stack of Coins 1C
Previous puzzle in this series
You and your friend are really lucky treasure hunters, because you’ve stumbled on another pirate’s treasure: an old chest filled with coins: 149 copper coins and 1 gold coin. As before, these old coins are no longer legal tender, so the copper ones are worthless. Only the gold coin is worth something due to its material.
To determine who gets the gold coin, your friend comes up with a game of wits. He stacks the 150 coins in a tall stack with the gold coin at the bottom. You and him will take turns taking anywhere between 3 to 12 coins from the top of the stack, all the way until the final coin is taken. If you reach 1 or 2 coins in the stack, he’ll take the gold coin, no matter whose turn it is to move (after all, you already won the 2 previous games). He lets you decide if you want to go first or second.
Should you go first or second? And what strategy do you use to ensure you’ll win the gold coin?
Hint
Try the previous puzzles first and see if you can extend the solution.
Solution
Choose to go second. After your friend makes a move, take 15−x coins, where x is the number of coins he took.
The trick to [puzzle
] is to notice that you want to find a “magic number” k such that:- Your friend can never remove k coins on his turn.
- No matter how many coins your friend takes, you can make a corresponding moves such that both your moves result in removing k coins from the stack.
Then you’d want to ensure the stack of coins is a multiple of k whenever it’s your friend’s turn to move.
This time, though, we cannot simply make k=12+1=13. This is because if your friend takes 11 or 12 coins on his turn, you cannot simply take 2 or 1 coin to bring the total down by 13 coins. Instead, k must be 15:
- If he takes 3 coins, you take 12.
- If he takes 4 coins, you take 11.
- If he takes 5 coins, you take 10.
- ...
- If he takes 12 coins, you take 3.
However, notice that the number of coins in the stack is already a multiple of 15. Thus, you should let your friend move first.
Next puzzle in this series
Try These Next
Coin Weighing 3
Your empire has grown even larger. Now 12 neighbouring kingdoms have each sent a single gold coin as tribute. Your advisor suspects that one coin is...
100, 10, 1
Your friend, Cole, shows you his first attempt at programming: a calculator that takes in a binary sequence and does an arbitrary computation on it: If the...
Traversing the Hypercube
Ossarion-429 is a multi-dimensional being travelling across hypercubes of various dimensions. Bored and having nothing else to do, he wonders to himself if...