Solution (and it took me ages to prove it worked all the way through):
Note, any marble proved OK we call X
test 1
1,2,3,4 vs 5,6,7,8 -> on the side 9,10,11,12
If = then 9,10,11,12 could be wrong (go to test 2a) the rest ok
If <> then 1,2,3,4,5,6,7,8,9 could be wrong (go to test 2b) the rest ok
Note: remember whether < or >
test 2
a)
9,10 vs 11,X -> on the side 12 (all others are OK=X)
If = then 12 must be wrong END
If <> then 9,10,11 must be wrong (goto test 3)
b) 1,X,X,7 vs 5,6,2,3 -> on the side 4,8 (all others are OK=X)
If = then 4,8 must be wrong (final test is a breeze so I won't continue END)
If previous test was < and this is < then 1,5,6 must be wrong (goto 3)
If previous test was < and this is > then 7,2,3 must be wrong (goto 3)
Note: Similar rules apply if previous test was >
Note: This is because moving balls from one side to the other will change the balance of the scales if one of those moved marbles is different from all others.
Note: remember whether this test was < or >
test 3
We now have one test to determine which of 3 remaining marbles is wrong depending on the results of previous tests, either :
9,10,11 - 1,5,6 - 7,2,3
We will work with 9,10,11 since the method is the same. You need to move the balls around again:
9,X vs 10,X -> on the side 11 (all others are OK)
If previous test was <> and this is = then 11 must be wrong END
If previous test was < and this is < then 9 is wrong END
If previous test was < and this is > then 10 is wrong END
So the trick is starting with 3 groups of 4 marbles. Put some on the side and determine some marbles that are proved to be OK. Then swap the marbles around and add in some OK marbles to make the scales tip one way or the other.