[ALGO] Six Colored Balls

We have two red, two green and two yellow balls. For each color, one ball is heavy and the other is light. All heavy balls weigh the same. All light balls weigh the same. How many weighings on a beam balance are necessary to identify the three heavy balls?

Source : http://gurmeetsingh.wordpress.com/puzzles/

1 comment:

Bhavin Shah said...

You can do it in two steps:
1. Pick two red balls, put each in either pans. Along with it put one green in one pan and one yellow in other pan. Weigh it, which can have following combination:
a. rh gh - rl yl
b. rh yh - rl gl

c. rh yl - rl gh
d. rh gl - rl yh

In cases a and b, one pan would have heavier balls, so in this step itself we can identify all heavy balls.

For cases c and d, balance would not tilt on either side and we need second step to get to answer.

2. Keeping the red balls in the same pan, remove other balls. This will indicate which is heavier ball and in turn tell us which were lighter and heavier balls of other colors.

[I have assumed that you can remember the balls already weighed but I think that's fair.]