TITLE: How to put eggs in baskets
QUESTION [7 upvotes]: A farmer has c chickens who have each laid e eggs, which she will put into b baskets.  Each basket has a probability p(d) of being dropped, which breaks all the eggs in the basket.  How should the farmer distribute the eggs into the baskets in such a way that she minimizes the number of chickens whose eggs all get broken?

REPLY [2 votes]: With different dropping probabilities for each basket, you should employ the following strategy:
For each chicken, put the first egg into the basket with the least probability to be dropped, the second egg into the basket with the second-least probability to be dropped, and so on. As soon as each basket has an egg of the chicken, it no longer matters where you put the other eggs (because the quantity you want to minimize is the number of chickens losing all eggs, not the expected number of broken eggs; as soon as all baskets have at least one egg of a chicken, you lose all eggs of that chicken iff you drop all baskets, no matter how the eggs are distributed).
This can be seen as follows:
First, the probability of a given chicken losing all eggs is the probability of losing all baskets which contain at least one egg. Therefore if there's at least one basket with more than one egg, and at least one basket without one egg, you can decrease the probability by moving one of the eggs from the two-egg basket to the no-egg basket (unless the probability of losing that basket is $1$, of course).
Second, you obviously can decrease the probability of losing all eggs of one chicken if you move all eggs from one basket into another empty basket that has less probability of being dropped.
So as long as you can do one of those moves, you are not at the minimum. Especially, for the minimum there may not be an empty basket with less probability than a non-empty basket, and furthermore, if not all baskets are filled, each basket may contain only one egg. The above filling rule ensures the two properties.
Note that "empty" in those considerations above has to be considered for each chicken separately. That is, a basket that contains eggs from another chicken is still considered "empty" if it doesn't contain any eggs from the chicken under consideration.
Note that this rule works even if you have a different numkber of eggs for each chicken.