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-03 22:19

>>3
Not really. You simply do a binary search. 12 balls is four weighings, 32 balls is 4 weighings.

Try this one: all the balls weigh slightly differently, but the combined weight of any two balls are heavier than any other ball. What is the least number of weighings needed to sort, say, 20 of them?

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