There are 4 wrenches just unpacked from a box. They all look the same. There might be one defective item which is either heavier or lighter. Fortunately there is a fifth one that is standard. If you can use a scale to weigh only 2 times, can you find out:
 Is there a defective wrench?
 If there is a defective item, is it heavier or lighter?
It's also possible to find a solution if a balance scale is used...
Call the 4 new spanners a,b,c,d and the standard spanner s.
Firstly, put s & a on one side of the scale and b & c on the other.
If s+a = b+c, then try s vs d.
 if s=d, then there are no defective spanners
 if s>d, then there is a lighter spanner (d)
 if s<d, then there is a heavier spanner (d)
If s+a > b+c, then try b vs c
 if b=c, then there is a heavier spanner (a)
 if b>c, then there is a lighter spanner (c)
 if b<c, then there is a lighter spanner (b)
Similarly, if s+a < b+c, then again try b vs c
 if b=c, then there is a lighter spanner (a)
 if b>c, then there is a heavier spanner (b)
 if b<c, then there is a heavier spanner (c)

Posted by fwaff
on 20040702 10:26:09 