Heavy Marble Interview Riddle
I recently got this riddle from a friend who was asked this at her Technical Interview:
You are given a bag with 8 marbles. The marbles are identical in size and shape. However, 1 out of the 8 marbles are heavier than the other 7. You are also given a 'Balance Scale' where you can put 'X' marbles on one side and 'X' marbles on the other side to see if they are equal in weight. The drawback to this scale is that you can only use it twice before it breaks. How can you determine which of the marbles is heavier only using the scale twice?
| | |
| | | OOOOOOOO
/ \ | / \ 8 Marbles
/ \ | / \
/____\ | /____\
Wednesday, April 23, 2003
First take six marbles and put three on either side of the balance scale. There are two things that could happen here:
1) One side is heavier than the other, so you know the heavy marble is one of those three
2) The scale is balanced, so the heavy one is one of the two not being weighed
In situation 1, you take the three marbles on the heavier side, and put one on each side of the balance and leave one off. If the balance tips, you have your heavy marble. If it doesn't, you know the heavy marble is the one you left off.
In situation 2, simply weigh the two marbles that weren't included in the first weigh, and the heavier one is the culprit.
This is very similar to the two pill weighing problems on this site/
Thursday, April 24, 2003
Fog Creek Home