Thursday, June 14, 2007

Logic Puzzle

"You have 9 metal balls. 8 of them have the same weight, 1 is heavier than others. How can you find the 1 which weighs different from others in 2 steps?"

This was a question a friend of mine was asked in his interview. Its an interesting logical question and not something people might expect to be asked in an interview. Its easy to solve once you know how. My friend asked me this question, and I started of saying "divide the balls into 4,4 and, 1 and weigh them." Its the right way to solve the problem but turns out that my solution would take 3 steps to find the ball.

The right answer is dividing the balls into 3, 3 and 3. And weighing 1 group against another. If 1 group is heavier - that one has the ball. If the 2 groups weigh the same, the heavier ball is in the last group. Now take the group with the heavier ball, and apply the same idea with 1 ball against another. You have your ball now... and the answer to the question.

1 comment:

Sunshine said...

Good one :) I have actually heard of a similar puzzle but not exactly same. The one I knew was to solve which penny weighs higher out of 6 pennies in 2 steps. First you divide pennies in groups of 3. Weigh 3 pennies against the other group. Figure out which group weighs more and then compare the single penny against other ones...So somewhat similar problem.