A Brain Teaser: Trial and Error
From The Sunday Times, 13th April 1952 [link]
A bank cashier has a pile of 364 similar coins of which one Is known to be of abnormal weight, the remainder being all of equal weight. For testing, he has only a pair of scales, in which he can balance one pile of coins against another.
What is the smallest number of such “trials” in which he can be sure of finding the odd coin, and what is the greatest number of coins among which he can likewise be sure of finding a single coin of odd weight in nine “trials”?
This one of the occasional Holiday Brain Teasers published in The Sunday Times prior to the start of numbered Teasers in 1961. A prize of 5 guineas was offered.
[teaser-1952-04-13] [teaser-unnumbered]
Jim Randell 9:38 am on 16 January 2022 Permalink |
We have tackled similar problems before, see: Enigma 1589, Teaser 2500.
For Enigma 1589 I wrote a constructive solution that searches for a minimal decision tree.
For Teaser 2500 I gave a program that will construct minimal decision trees for a set of related problems.
For a “type 1” problem (where we need to find the counterfeit coin, and determine if it is heaver or lighter), with n weighings we can deal with a set of (3^n − 3) / 2 coins.
However, each decision tree for the “type 1” problem has a leaf that is impossible to reach if we are guaranteed that there is exactly one counterfeit coin. But if there are no counterfeit coins then every weighing balances and we reach the impossible leaf.
So, for this type of puzzle (where we need to determine which coin is counterfeit, but not if it is heavier or lighter), we can put one of the coins aside and then proceed with the weighings for a “type 1” puzzle, if we reach the impossible leaf we know that it must be the unweighed coin that is counterfeit, and we don’t need to determine whether it is lighter or heavier, so we can stop. This means we can manage 1 extra coin compared to the “type 1” puzzle.
So in n weighings we can deal with a set of (3^n − 1) / 2 coins. (The same as a “type 2” problem, where we have to determine the counterfeit coin, and whether it is lighter or heavier, but we have a reference coin available).
Hence:
With 6 weighings we can deal with a set of (3^6 − 1) / 2 = 364 coins.
And with 9 weighings we can determine the counterfeit coin from (3^9 − 1) / 2 = 9841 coins.
Solution: 364 coins require 6 weighings. With 9 weighings we can deal with up to 9841 coins.
Note that the formula applies to n ≥ 2 weighings.
A set consisting of 1 coin requires 0 weighings (as the set must contain a counterfeit coin), and with a set consisting of 2 coins it is not possible to determine which coin is counterfeit (unless we have a reference coin, or are told that the counterfeit is light (or heavy)).
With 4 coins (1, 2, 3, 4) we can weigh 1 against 2. If they balance (and so are both good), we weigh one of these good coins against 3. If the second weighing balances, the counterfeit is 4. If it doesn’t balance, it is 3. If the initial weighing does not balance, then the counterfeit coin is 1 or 2, and 3 and 4 are good. So weigh 1 against 3. If they balance, the counterfeit is 2. If not the counterfeit is 1. So we can solve 4 coins with 2 weighings.
The published solution (27th April 1952) is as follows: [link]
LikeLike