Quote
your solution will not work all the time, because if there is equilibrium it could be either of the balls on each side that could be the heavy one. meaning even if you changed the color balls you could get the same configuration again when replaced with the ones left.
Here is how it works:
Case I (first weighing gives equilibrium)
2 possibilities: Bw rW or
bW Rw
in your next weighing, you get
w W or
W w
You have now identified all the other balls - those you have weighed and those you have not.
Case IIa (first weighing left side heavier)
BW rw you instantly identify all the heavier and lighter balls
Case IIb (first weighing right side heavier)
bw RW you instantly identify all the heavier and lighter balls