Question { Wipro, 33434 }
You have 8 balls. One of them is defective and weighs less
than others. You have a balance to measure balls against
each other. In 2 weighings how do you find the defective
one?
Answer
divide the balls into three groups. Let group A contains 3
balls group B contains 3 balls and group C contains 2 balls.
FIRST TIME: BALANCE the groups A and B.
case 1:
If they are equal then the defective ball is in group C.
case 2: if they are not equal then take the group of 3
balls which has less weight.
SECOND TIME:
IF the defective ball is in group C, we can easily find the
ball which is less.
if the defective ball is in group of 3 which has less
weight, take 2 balls out of this group and find the weight.
if they are equal, then the left out is defective. if not
we can find easily the ball which weigh less.
so we have the following steps:
A (3) B(3) c(2)
|_____________| |
first time /\ |
unequal equal then c has defective.use
| second time to find out
second time take lessweight group