Easy and popular version : There are 8 balls that look identical. One of them weighs less than the others. Given a weighing scale, how will you find this ball.
Answer : Split the balls into groups of 3-3 and 2 (and this is the trick). Name these groups A,B and C. Now, lets weigh group A and B. If both are equal – > the lighter ball is in group C.
If A is lighter than B – > Compare A1 and A2 -> Both are equal -> A3 is the lighter.
-> A1 is lighter than A2 -> A1 is lighter
-> A2 is lighter than A1 -> A2 is lighter
If B is lighter than A – > Compare B1 and B2 -> Both are equal -> B3 is the lighter.
-> B1 is lighter than B2 -> B1 is lighter
-> B2 is lighter than B1 -> B2 is lighter
Answer : Split the balls into groups of 3-3 and 2 (and this is the trick). Name these groups A,B and C. Now, lets weigh group A and B. If both are equal – > the lighter ball is in group C.
If A is lighter than B – > Compare A1 and A2 -> Both are equal -> A3 is the lighter.
-> A1 is lighter than A2 -> A1 is lighter
-> A2 is lighter than A1 -> A2 is lighter
If B is lighter than A – > Compare B1 and B2 -> Both are equal -> B3 is the lighter.
-> B1 is lighter than B2 -> B1 is lighter
-> B2 is lighter than B1 -> B2 is lighter
0 comments:
Post a Comment