LibraryQuant brainteasers
You have 12 coins that look identical. Exactly one of them is counterfeit and has a different weight from the other 11, which all weigh the same as each other. Nobody has told you whether the counterfeit is heavier or lighter, and it could be either.
You have a two-pan balance and no weights. Each use of the balance tells you one of three things: the left pan is heavier, the right pan is heavier, or the two pans balance. You get three uses in total.
Find the counterfeit coin and say whether it is heavy or light. Then say how large the pile could have been before three weighings stopped being enough.
Count how many different statements the final answer could be, then think about what a pan that balances tells us about the coins on it.
A balance is a ternary measurement, not a binary one, so the resource being spent is the logarithm base three of the number of outcomes to separate. Count outcomes first to find the ceiling, then design a weighing schedule that splits the remaining possibilities into three nearly equal parts every single time, because any weighing that cannot go three ways is wasted.
You have the question, a hint and the idea. It gives a full weighing plan that finds the counterfeit and says whether it is heavy or light, with the reasoning behind each weighing.