Weighted balls in bins strategy?

Here's a rather simple problem, but it's fairly cute and open to a whole gamut of possible extension problems. Consider three bins. Each bin contains many balls. In one of the bins, each ball weighs 2, in another bin each ball weighs 3, and in the last each weighs 5 [units are arbitrary]. We don't... show more Here's a rather simple problem, but it's fairly cute and open to a whole gamut of possible extension problems.

Consider three bins. Each bin contains many balls. In one of the bins, each ball weighs 2, in another bin each ball weighs 3, and in the last each weighs 5 [units are arbitrary]. We don't know which bin is which.

Find a way to take determine which bin is which with only one weighing. You may take as many balls from as many bins as you wish.

Bonus: since that should be fairly easy, can you find a description of ALL such strategies?
Update: A couple examples are probably in order. If I take x balls from one of the bins, I find weight 2x, 3x, or 5x; then I know the weight in the bin which I chose from, but not which of the other two bins is which. So this won't work. If I take one ball from each bin, I get a weight of 10, but this doesn't... show more A couple examples are probably in order.
If I take x balls from one of the bins, I find weight 2x, 3x, or 5x; then I know the weight in the bin which I chose from, but not which of the other two bins is which. So this won't work.

If I take one ball from each bin, I get a weight of 10, but this doesn't help at all.
Update 2: But not any prime number of balls will work; for instance here 3,1 doesn't work (3*3+2*1=3*2+1*5). It isn't hard to argue that we need to choose x balls from one bin and y from another (and none from the last); for which pairs (x,y) does this work? The generalizations to multiple bins and with different... show more But not any prime number of balls will work; for instance here 3,1 doesn't work (3*3+2*1=3*2+1*5). It isn't hard to argue that we need to choose x balls from one bin and y from another (and none from the last); for which pairs (x,y) does this work?

The generalizations to multiple bins and with different weights of balls is interesting, but I'm more interested presently with a general solution to this case.
2 answers 2