This is a very popular puzzle, originating from at least as early as 1945, along with some closely related but less popular extension questions.
The Problem
You have twelve coins. You know that one (and only one) is a forgery, and is of a different weight to the other eleven coins. You have a balance allowing you to determine which of two sets of coins is heavier (but no other information).
Prove that you can always determine the forged coin and whether it is lighter or heavier within three uses of the balance.
Bonus Question 1
Prove that you cannot do this if there are more than coins.
Bonus Question 2
Can you do this if there are exactly coins?
Bonus Question 3
What happens if a forgery is not guaranteed to exist? Can you always tell within three uses of the balance whether it does (and if so, determine which coin is the forgery and its relative weight?)
Solutions below! Do not scroll down until you have attempted all the problems.
Solutions
In fact, the answer to the final bonus question is “yes”! This means the original problem must also be possible using the same strategy: there will simply be one state which doesn’t arise.
Bonus 1: More Than 13 Coins
Suppose there are coins. Then in total there are states to distinguish between, in , which corresponds to at least bits of uncertainty.
Each weighing has three outcomes (left heavier, right heavier, or balance) and thus can provide at most bits of information.
Therefore 3 weighings provide at most bits of information, which cannot possibly be enough to consistently distinguish all states.
Bonus 2: Exactly 13 Coins
Suppose . There are 26 possible states to distinguish between, which naively should be possible. However, consider the first weighing, WLOG between coins and .
Obviously, we want , otherwise the weighings are unbalanced, and anything could happen. Precisely, suppose the side with more coins is heavier. We have gained literally zero information: every state is still possible.
Since there are still possible states, and we can obtain at most bits of information with our two further weighings, clearly we cannot always detect the forgery and its nature. Thus it cannot be possible to guarantee detection in three weighings if the first weighing is unbalanced.
From now on, we therefore weigh the first coins against the next coins.
Now, suppose . If the coins balance, then there are still remaining states, given by the remaining $m-2r$ coins. This requires at least bits of information to distinguish, and therefore we cannot guarantee a solution in two further weighings.
Conversely, suppose . If the coins do not balance, there are still remaining states, which again for the same reasons means we cannot guarantee a solution in two further weighings.
Therefore no matter what arrangement we pick for the first weighing, there is some situation in which we have insufficient further information to distinguish betwen the remaining possibilities with our two remaining weighings. This means we cannot guarantee discovery of the forgery within three weighings, even when .
Bonus 3: Without A Guaranteed forgery
Label the
coins
. There are
total cases: label them by
for each coin being a heavy forgery,
for each coin being a light forgery, and X
for the coins
all being real.
When I say “weigh some set against some set ”, these refer to the left and right hand sides.
First, weigh coins
against
. If they balance, then we have the nine possible cases
and X
. For the second weighing, weigh
against
.
- Suppose they again balance. Then must be the forgery, if one exists. Weigh against . If is heavier or lighter the weighing confirms this, and if they balance there is no forgery.
- Suppose instead that the right hand side is heavier. Then we have , , or . Weigh against — the lighter coin is the forgery and is lighter than the real coins, or if they balance 11 is the forgery and is heavier than the real coins.
- Suppose instead that the left hand side is heavier. Then we have , , or . Weigh against — the heavier coin is the forgery and is heavier than the real coins, or if they balance is the forgery and is lighter than the real coins.
Otherwise, suppose without loss of generality that the right hand side is heavier. (If the left hand side is heavier, we may just relabel the coins).
We therefore have or , which is total cases to distinguish with the two remaining weighings. Weigh against .
- Suppose the right hand side is again heavier. Then we have one of , , or . Weigh against — the lighter coin is the forgery and is lighter than the real coins, or if they balance then is the forgery and is heavier than the real coins.
- Suppose the left hand side is now heavier. Then we have one of , , or . Weigh against — the lighter coin is the forgery and is lighter than the real coins, or if they balance then is the forgery and is heavier than the real coins.
- Finally, suppose they balance. Then either or is the forgery — weigh them against each other to identify the forgery, which is heavier than the real coins.
Therefore, three weighings is sufficient to identify whether there is a forgery, and if so which coin and whether it is heavier or lighter than the other eleven coins.