Let be a positive integer. Consider a pile of coins, one of which is fake. Suppose that all coins are either white or black and that if the fake coin is white, it is lighter than the others, and if the fake is black, it is heavier than the others. Furthermore, assume that the number of white coins and the number of black coins differ by at most one. Under these conditions, prove that the fake coin can be identified and classified as heavy or light by at most weighings in a scale.
Solution
For each , let be the statement to be proven. We will argue by induction. Indeed,
* Base step: For , consider coins, and without loss of generality, suppose that two are black and one is white. Put a black on each pan and set the white aside. If the scale balances, then white coin is counterfeit, and since it is white, is lighter than the other coins. If the scales tips, say the left side down, then the black on the left is heavy and fake. In any case, the counterfeit coin is identified from among three coins and classified as heavy or light, so holds.
* Next we consider the case when , assuming, for the moment, that has been shown. Consider coins, with, say, 14 black, and 13 white. Partition these 27 coins into three groups, say , , and . Put on the left, weighed against on the right. If the scale balances, the counterfeit coin is in group and so applies to a set of 9 coins, 4 black and 5 white. If the left pan goes down, either one of the 5 black from is heavy, or one of the 4 white from is light. The induction hypothesis now applies to these coins. Similarly, if the scale tips to the right, the counterfeit is among the 4 white in or the 5 black in , and again applies.
* Inductive step: Fix and assume that is true. Consider a collection of coins, one of which is counterfeit. Assume that there is one more black than white (the same argument works if there is one more white than black), so suppose that are black and are white. Partition the coins into three groups, , and , each with coins, and each with a near balance of black and white: In , put black and white coins. In both and , put black and white coins. Putting aside, weigh on the left against on the right. If the scales balance, the counterfeit coin is in , and applies to , finding the fake coin in an additional weighings, in all, and so is true in this case. If the scales go down on the left, either one of the black coins from is heavy, or one of the white coins from is light and these
coins satisfy the hypothesis for , and so the coin is found in weighings. The analogous argument works when the right pan lowers.
Finally, by mathematical induction, for each , we conclude that holds.