Sunday, July 8, 2007

Interview puzzle

Many people who had several interviews may have faced this puzzle as I faced It and I thought of sharing the solution with you.


Puzzle: We have 8 balls with the same size.7 balls hve the same weight and the remaining one is heavier.Having a balance, how can you determine the heavier ball with only 2 weightings.


Answer:
take 6 balls and weight them (3 balls in each side) "First weighting".

If the two sides are equal then none of the 6 balls is the heavier:
- Weight the remaing 2 balls "second weighting" so you can get the heavier one.

Else If the two sides are not equal so the heavier ball will be in the heavier side and that makes 3 remaining balls with equal probability of being heavier than each other.

-Take one in hand and weight the other two "second weighting":
If they are equal so the hevier one is in your hand.
else sure the balance will tell youuuuuuuuuuuu.

Enjoy..........



No comments: