Finding the heavy coin with a balance
Statement
Among coins, exactly one is heavier than the others, which all have the same weight. You may use a balance scale (comparing the weights of two groups, with three possible outcomes: left heavier, right heavier, balance).
- Prove that if , the heavy coin can always be found in weighings.
- Prove that if , it is not always possible to find it in weighings.
Hint
For part 1, divide the coins into three equal groups. For part 2, count the possible sequences of outcomes.
Show solutionHide solution
Solution
1. Strategy. Induction on . For there is a single coin. For , divide the coins into three groups of coins and weigh against .
- If is heavier, the heavy coin is in ; if is heavier, it is in .
- If the scale balances, it is in .
In each case, the heavy coin is among coins, which can be found in further weighings by the induction hypothesis. In total weighings suffice.
2. Lower bound. Fix a strategy using at most weighings. Each possible heavy coin gives a sequence of at most outcomes, each outcome being one of values. There are at most such sequences.
If two different coins gave the same sequence, the strategy could not tell them apart. So a strategy that always finds the coin must give distinct sequences to distinct coins, hence . Therefore coins cannot be handled in weighings.
Remark. An information-theoretic argument: each weighing provides at most bits of information. The harder variant with a coin that may be heavier or lighter is solved by the same principle: coins in weighings.
Lesson. Optimal algorithm problems come in two halves: an explicit strategy, and a counting argument on outcomes showing that nothing better is possible.