Given 12 coins such that exactly one of them is fake (lighter or heavier than the rest, but it is unknown whether the fake coin is heavier or lighter), and a two pan scale, devise a procedure to identify the fake coin and whether it is heavier or lighter by doing no more than 3 weighings.
Weight any 4 with any other 4.
Case 1. This first weighing (4 with 4) balances.
Then the 8 coins that you weighed are all good and the 4 that you didn't weigh are suspects for the fake coin.
Weigh 3 good coins against 3 suspect coins.
A. If they balance then the remaining suspect coin is the fake coin, so then you weigh the fake coin with one of the good coins to see whether its heavier or lighter.
B. If they don't balance then you can tell whether the suspect coin is heavier or lighter, so weigh one suspect coin with another. If they weigh the same, the remaining one is the fake one, and if they don't, you know which of the two on the scale is the fake one because you already know whether it's heavier or lighter.
Case 2. The first weighing 4 with 4 doesn't balance. Then put two from the heavier side and one from the lighter side on each side of the scale.
A. If they balance then you know the fake coin is one of the two from the previous lighter side that you didn't weigh, and you also know that the fake coin is lighter. So weigh one of those with a good coin. If those balance then you know the one you didn't weigh is the fake coin and you know it's lighter. If they don't balance, then the lighter one on the scale is the fake one.
B. If they don't balance, then the fake coin is either one of the ones on the PRESENT heavy side from the PREVIOUS heavy side and it's heavier, or you know that the fake coin is one from the PRESENT lighter side from the PREVIOUS lighter side and it's lighter. Now from the PRESENT heavy side, weigh one from the PREVIOUS heavy side with the other from the PREVIOUS heavy side. If they weigh the same, then the fake coin is the one from the PREVIOUS lighter side and it's lighter. Otherwise the heavier one from the PREVIOUS heavier side is the fake coin and it's heavier.