Coin weighting problem There are n coins, among which there may or may not be one counterfeit coin. If there is a counterfeit coin, it may be either heavier or lighter than the other coins. The coins are to be weighed by a balance.
What is the coin-weighing strategy for 3 weighings and 12 coins(find the counterfeit coin if it is there and tell me whether it is too lighter or heavier)?
I think I can find the counterfeit coin between two(4-2-1). But I cannot determine which one of the two and whether it is too lighter or heavier.
I'm not sure what tags the problem belongs to. I put it in probability,everyone can help me retag it.
 A: Let us call the coins 1,2,..., 12. I will note {...} the weight of the coins labelled inside the curly brackets.


*

*If {1,2,3,4} = {5,6,7,8} then the searched coin is either 9,10,11 or 12.
Then compare {1,2} to {9,10}. 


*

*If {1,2}={9,10} the searched coin is 11 or 12 otherwise it's 9 or 10. Let us name them $x$ and $y$. If {$x$}={1} then $y$ is the searched coin otherwise it's $x$.


*If {1,2,3,4}<{5,6,7,8}, this is more tricky


*

*If {1,2,5} < {3,4,6} the coin you search is 1 or 2 and is lighter or it is 6 and it is heavier. In that case, if {1}<{2} then the searched coin is 1, if {1}>{2} the searched coin is 2 and if {1}={2} the searched coin is 6.

*If {1,2,5} = {3,4,6} the coin is 7 or 8 and it is heavier. You can compare them and take the heaviest.

*If {1,2,5} > {3,4,6} the coin you search is either 5 and is heavier it is 3 or 4 and it is ligther. If {3}<{4} then the searched coin is 3, if {3}={4} then it is 5 and if {3}>{4} then it is 4.


*If {1,2,3,4} > {5,6,7,8}, follow the same procedure as in the preceding case.
A: Washington State University mathematician Calvin T. Long is really novel,or extraordinary
Here is the solution 
Number the coins 1 to 12 and make three weighings:
First weighing: (Left pan) pan)1 3 5 7 
vs. 2 4 6 8(Right pan)
Second weighing: (Left pan)1 6 8 11 
vs. 2 7 9 10(Right pan)
Third weighing: (Left pan)2 3 8 12 
vs. 5 6 9 11(Right pan)
To solve the problem, note the result of each weighing and assemble a three-digit numeral in base 3 as follows:
Left pan sinks: 2
Right pan sinks: 0
Balance: 1
For example, if coin 7 is light, that produces the number 021 in base 3. Now converting that to base 10 gives 7, the number of the odd coin, and an examination of the weighings shows that it must be light. Another example: If coin 2 is heavy, then we get 002 in base 3, which is 2 in base 10. 
When you take the case coin no 7 defective (heavier )then also the base 10 no will be greater than 12 because the ternary code will be 201
Then corresponding base10 no will be 19
So 26-19=7 
Therefore 7ᵗʰ coin is defective,  (heavier)
