Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

12 Balls, 1 slightly heavier

Name: Anonymous 2009-10-01 16:22

I got asked this question at least in 3 different job interviews!  What's the point?  What are they "looking" for?

At least the next 2 times, I already had the answer and just spewed it out.

The question:

You have 12 identical balls but one slightly heavier.  You also have a balance scale.  How would you isolate the slightly heavier ball using the balance scale as little as possible?

Answer:

Divide the balls into 2 groups of 6.  Use the balance scale to find the slightly heavier group and discard the lighter one.  Then divide the remaining 6 into 2 groups of 3 and weight on the scale.  Discard the lighter 3 balls.  Now take 2 of the remaining 3 balls and compare them on the scale.  If they weight the same, then the left over one is heavier.  If there's a difference, then take the heavier one on the scale.

Name: Anonymous 2009-10-06 12:44

make three groups(a,b,c) containing four balls each
weigh group a and b, if they're equal take group c

then weigh c[0] and c[1]
then weigh c[1] and c[2]

if both weighs are equal then c[3] is the oddball, if the first one if unequal and the second is equal, it is c[0], if both are unequal, it is c[1] if the first is equal and the second is not take c[2].

else if a and b are unequal
we take the lighter group and call it l
we take the heavier group and call it h

take l[0],h[0],c[0] weighed against l[1],l[2],h[1]

if the scales are equal then
we weigh h[2] and h[3] if they're equal then l[3] was the culprit. Otherwise the lighter of the two was bad.

if the scales tipped toward l[0],h[0],c[0] then we weigh h[1] v c[0] if it is heavier than h[1] is the oddball, otherwise l[1] is.

if the scale tipped toward l[1],l[2],h[1], we weigh l[1] and l[2] and the oddball is whichever is lighter.

I hope that makes sense.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List