tags:

views:

28

answers:

1

Given n red balls and m blue balls and some containers, how would you distribute those balls among the containers such that the probability of picking a red ball is maximized, assuming that the user randomly chooses a container and then randomly picks a ball from that?

Please can anyone help me calculate this

A: 

Assuming p containers:

If n >= p, put one red ball into p-1 of the containers and the remaining n-p red balls and all m blue balls into the final container. Odds of picking a red ball are p-1/p + 1/p * (n-p)/m+n-p.

If n < p, put one red ball into n of the containers and m blue balls into one of the empty containers. Odds of picking a red ball are n/p. Note that in some cases you may pick an empty container.

I.e. Start by maximising the chance of picking a container that only contains a red ball (so the odds of the ball from that container being red is then 1).

borrible