This is indeed a beautifully simple problem. However, the answer is perhaps not quite so simple.
Four different solutions are listed below:
The following solution was submitted to curiouser.co.uk by Peter Harrison who is a regular contributor to the Sunday Times Teaser column in the Magazine:
The usual approach to solving this puzzle, by a process of elimination, is both clumsy and difficult to follow. How about this for a different approach!
Every weighing has three outcomes – Left side heavier (L), Balance (–) or Right side heavier (H) If there are three weighings, then there are a maximum of 3³ = 27 outcomes. We need only 24 (12 balls either heavier or lighter) to identify the odd ball and whether it is heavier or lighter.
So if we pre-plan the weighings we can plan for each ball to have a different outcome pattern which will therefore identify the offending ball.
First, number each ball from 1 to 12 and carry out three weighings as follows
First Weighing: 1, 2, 3, 4 in left hand pan and 5, 6, 7, 8 in right hand pan
Second Weighing: 1, 3, 5, 6 in left hand pan and 2, 9, 10, 11 in right hand pan
Third Weighing: 1, 4, 7, 10 in left hand pan and 2, 5, 11, 12 in right hand pan
This arrangement is planned so that that no two balls are weighed in exactly the same way so that if the balance tips to the left every time, then only ball number 1 could cause this, so culprit is ball 1 and heavier. If it tips to the right on the first and third weighings, then only ball 4 can be responsible and is lighter.
The outcomes can be summarised as follows:
L L L or (R R R) ~ Ball 1 & heavier (or lighter if outcome is the one shown in brackets)
L R R or (R L L) ~ Ball 2 & heavier (or lighter)
L L – or (R R –) ~ Ball 3 & heavier (or lighter)
L – L or (R – R) ~ Ball 4 & heavier (or lighter)
R L R or (L R L) ~ Ball 5 & heavier (or lighter)
R L – or (L R –) ~ Ball 6 & heavier (or lighter)
R – L or (L – R) ~ Ball 7 & heavier (or lighter)
R – – or (L – –) ~ Ball 8 & heavier (or lighter)
– R – or (– L –) ~ Ball 9 & heavier (or lighter)
– R L or (– L R) ~ Ball 10 & heavier (or lighter)
– R R or (– L L) ~ Ball 11 & heavier (or lighter)
– – R or (– – L) ~ Ball 12 & heavier (or lighter)