Here is the full solution; divide the 12 into sets of 4 -- X={1,2,3,4} ; Y={5,6,7,8} ; Z={9,10,11,12}
Comparison 1 : X v/s Y
If X=Y, we know the offender is in Z
Comparison 2 : {9,10,11} with {5,6,7}
If they are equal, we know offender is 12. To find out if it is more or less than others, takes
one more comparison with any normal sample
If they are not equal we immediately know if counterfeit one is more or less by seeing if {9,10,11} is more or less. Then
compare 9 & 10 in measurement 3, if equal answer is 11 else we know the answer between 10 & 11 since we now know if the offender is less or more
If X>Y, we know the offender is in either one of these 2 sets and Z is clean
Comparison 2 : {1,5,9} with {2,7,6}
If they are equal means offender is one of {4,5,8} ... to find out which one
compare 4 & 8 with 9 & 10 (both of which are normal). If equal answer is 5. If not, we know lesser or more, hence we know which one of X & Y had the counterfeit, and so we also know if answer is 4 or 8. So done
If {1,5,9} > {6,7,2}, and since X>Y, we know either 1 is more active or one of 6 or 7 is less active.
In the third go, weigh 1 & 7 with 11 & 12 (both genuine). If this last measurement comes equal, answer is 6. If not, we know immediately if its 1 or 7 depending on whether answer is lesser or more.
If {1,5,9} < {6,7,2} and since X>Y, we know either 2 is more active or 5 is less active.
Compare 2 with 12, and we will know the answer immediately. So done
If X<Y, the case is exactly symmetric to the one above.