Quan Pham from Vietnam discovered the following method.

We divide the weights into three groups of four, group A (weights 1-4, say), group B (5-8) and group C (9-12).

1. Weigh group A against group B.

Case: A = B

The odd weight must be in group C.

2. Weigh 9, 10 and 11 against 1, 2 and 3.

If it balances then the odd one is weight 12.

3. Weigh 12 against 1

This will determine whether 12 is lighter or heavier.

If weight (9 + 10 + 11) > weight (1 + 2 + 3) then we know that the odd weight is one of 9, 10, 11 and is heavier. Similarly if weight(9 + 10 + 11) < weight(1 + 2 + 3) then one of 9, 10, 11 is lighter. Either way, our final weighing will be

3. Weigh 9 against 10

If the scales are uneven we can work out which one of 9, 10 is the odd weight, and if they are even then clearly our odd weight is 11.

Case: A > B

The odd one is either in group A, in which case it is heavier, or in group B and is lighter.

2. Weigh 1, 5 and 9 against 6, 7 and 2

If the scales balance then the odd one is 3, 4 or 8. In this case we weigh

3. 3 and 8 against 9 and 10

If the scales balance then the odd one is 4. If weight(3 + 8) > weight(9 + 10) then the odd one is heavier, so must be in group A, which means it is 3. Similarly if weight(3 + 8) < weight(9 + 10) the odd one is 8.

If weight(1 + 5 + 9) > weight(6 + 7 + 2) then either 1 is heavier or 6 or 7 are lighter. In this case we weigh

3. 1 and 6 against 9 and 10.

We can find the odd weight using a similar method to the previous step 3.

If weight(1 + 5 + 9) < weight(6 + 7 + 2) then either 5 is lighter or 2 is heavier. Weight

3. 5 against 9

and we will discover which is the odd one.

Case: A < B

We argue in a way analogous to the case A > B.