So there's a counterfeit coin variant that I stumbled across and I'm not sure exactly how to solve it.
It goes as follows:
You have eight coins, two of which are counterfeit. One of the two is slightly heavier than normal, the other is slightly lighter. The two counterfeit coins have the same combined weight as two normal coins.
You have a balance. How many weighings are necessary to identify both the heavier and lighter coin?
I can do it in five, but I strongly suspect you can do it in fewer.
EDIT: Solution for five weighings:
Label your coins 1 through 8. Weigh 1 against 2, 3 against 4, 5 against 6, 7 against 8. If we get three balanced scales and one imbalanced scale, we know which two coins are counterfeit. If we get two balanced scales and two imbalanced scales, assume without loss of generality that 1 was heavier than 2 and 3 was heavier than 4. From this we can deduce that either 1 is the heavy counterfeit and 4 is the light counterfeit, or 2 is the light counterfeit and 3 is the heavy counterfeit. Therefore, we weigh 1 against 4. If they are balanced, then 2 is the light counterfeit and 3 is the heavy counterfeit. Otherwise, 1 is heavy and 4 is light.
EDIT: As mentioned by Mees de Vries below, 3 weighings with 3 possible outcomes each can only distinguish between 27 possible scenarios. We have 56 total possible configurations, and so 4 weighings must be optimal if it is possible.
Yes, 4 weightings is possible. Even more, this is still true even if it is not known whether the combined weights of the 2 counterfeits is heavier, lighter, or same as that of 2 normal coins
Notation
First, let's introduce some notation.
Coins are labelled
1through8.H,L, andndenotes the heavy counterfeit, the light counterfeit, and a normal coin, respectively.Weightings are denoted, for instance,
12-34for weighting coins1and2against3and4. The result is denoted12>34,12=34, or12<34if12is heavier, weights the same as, and lighter than34, respectively.1234:HmeansHis among coins1,2,3, and4. Similarly,1234:LmeansLis among coins1,2,3, and4.Due to the highly symmetric nature of the problem. A lot of without-loss-of-generality assumptions will be made. As such, they will not be called out.
Algorithm
Begin by
12-34and56-78.Case 1: Double unbalanced (
12>34, 56>78)In this case, we know that either
12:H, 78:Lor56:H, 34:L. Do13-57next.If
13>57, then either1:H, 7:Lor1:H, 8:Lor2:H, 7:L. These can be distinguished by28-nn.If
13=57, then a simple2-8to distinguish2:H, 8:Land6:H, 4:LCase 2: Balanced-unbalanced (
12>34, 56=78)In this case, we know that
12:Hand/or34:L. Do1-2next.If
1>2, then1:H, 234:L. A simple2-3resolves that.If
1=2, then either3:H, 4:Lor4:H, 3;L. So3-4.Case 3: Double balanced (
12=34, 56=78)This means both
HandLis within the same pair. Do135-246.If
135>246, then either1:H, 2:L,3:H, 4:L, or5:H, 6:L. Do1-3to distinguish.If
135=246, then either7:H, 8:Lor8:H, 7:L. Do7-8to distinguish.