[Math] Distribute black and white balls to maximize probability

probabilityprobability theory

Take the following problem:

You have 100 balls (50 black balls and 50 white balls) and 2 buckets. How do you divide the balls into the two buckets so as to maximize the probability of selecting a black ball if 1 ball is chosen from 1 of the buckets at random?

If you put 1 black ball in one bucket and all the other balls in the other bucket then you will maximise the probability of picking a black ball, since there is a 50% chance of picking either bucket, so the probability becomes $$P(B)=(0.5\times1)+\Big(0.5\times \frac{49}{99}\Big)=0.75=75\%.$$ How can this be expressed mathematically? I.e. how does one maximise $$P(B)=\frac{0.5N_{B1}}{N_{B1}+N_{W1}}+\frac{0.5N_{B2}}{N_{B2}+N_{W2}},$$ where $N_{B1}$ is the number of black balls in the 1st bucket, $N_{W1}$ is the number of white balls in the 2nd bucket and so on.

Is there a general method for maximising probabilities? Do we have to somehow differentiate?

Best Answer

Here is a clever answer without doing math(or differentiation).

Link to answer

The idea is simple and clever. If black equals white in both bucket, it's obvious 1/2. If not, then one bucket must have more white and another must have more black. Observing this, it's obvious how to get the maximum. Black>white, maximum is 1, black less than white, maximum is 49/99. And this is feasible. Thus solution!

Related Question