This recent question reminds me of a coin weighing puzzle I learned many years ago. It is one of the hardest puzzles of this kind that I know. I will post my solution in a few days, and meanwhile hopefully someone may enjoy it. (My apologies if this is a repeat, but I searched and could not find this exact version.)
There are $14$ suspect coins, $13$ of which are good and have the same weight, and the last one is bad and have a different weight (heavier or lighter). In addition, you have a $15$th coin that is known to be good.
You want to find which suspect coin is bad, and as much as possible (see below), whether it is heavier or lighter. There are therefore $28$ possible answers: $14$ suspects $\times \{heavier, lighter\}$.
You are allowed $3$ weighings on a balance. Now of course, $3$ weighings only give you $3^3 = 27$ possible outcomes, so you cannot fully distinguish all $28$ answers. The requirement is that:
$26$ of the $27$ outcomes must lead to a unique answer (which coin is bad and whether it is heavier or lighter)
while the last outcome must lead to knowing which coin is bad, but without knowing if it's heavier or lighter (i.e. it lumps together the $2$ answers for that coin).
The above puzzle would be difficult enough, but here's the final twist: What coins to use in a weighing cannot depend on the results of previous weighings.
To be more precise, label the suspect coins ABCDEFGHIJKLMN and the known-to-be-good coin X. Before you begin, you must write down what two subsets of coins are involved in each of the $3$ weighings, e.g. ABCDX-EFGHN, IJKL-MNAB, CDEFGH-IJKLMN. This way, your second weighing IJKL-MNAB is pre-determined and cannot depend on the result of the first weighing ABCDX >/=/< EFGHN, etc. (Indeed, you can now do the $3$ weighings in any order.)
Can you find such a set of $3$ pre-determined weighings that meets the requirement?
HINT #1: The outcome $(=, =, =)$, i.e. all $3$ weighings being equal, can only happen if the bad coin is not used in any weighing at all. This corresponds to the 2nd bullet of the requirement. I.e. in any correct solution, there is exactly one coin that is unused in any weighing, and the outcome $(=,=,=)$ maps to this coin being bad, but without knowing if the coin is heavier or lighter.
HINT #2: Let the $28$ answers be $S = \{A+, A-, B+, B-, ..., N+, N-\}$ where $+$ and $-$ mean heavier and lighter respectively. Meanwhile, the $27$ outcomes form a $3 \times 3 \times 3$ cube, which we can denote $T = \{-1, 0, +1\}^3$, where $-1, 0, +1$ denote the left side of the balance being lighter, equal, or heavier. We need to find a mapping $f: S \to T$ with these properties:
- Hint #1 already shows that $f(N+) = f(N-) = (0,0,0)$.
- The remaining $26$ answers and $26$ outcomes must map bijectively.
- Pre-determined weighings $\implies f(A+)$ and $f(A-)$ are related in a certain way. How?
- What other constraints do we need on $f$?
Suppose a triple of weighing results determines a coin. If a weighing result is "equal" then the coin did not appear in that weighing. Otherwise, the coin appeared on either the "less" side of each weighing or the "greater" side of each weighing depending on whether the coin was lighter or heavier.
For each coin, then, choose a distinct weighing result pattern that will determine that coin. (Weighing result patterns that are completely flipped must identify the same coin with the opposite weight, so we won't use these.)
Then we know exactly how to assemble each weighing (ie
Aappears in the first weighing only;Gappears on opposite sides of the first two weighings;Jappears on the same side of all weighings; etc) except that we don't know which side to put the coins on, but deciding the sides turns out to be easy, as we merely need to balance the number of coins in each weighing. CoinX(the known good coin) is needed because there are otherwise nine coins involved in each weighing. We will not be able to distinguish between coinNbeing lighter or heavier.One solution is