[Math] 5 distinct balls into 2 distinct bins.

combinatorics

Say we have 5 distinct balls being placed into two distinct bins.
If each ball has 2 options of where it can go,
This would make (2x2x2x2x2) combinations, 2^5.

If each bin may not be empty, how would we account for and subtract those cases where a bin is left empty using combinatorics or logic?

Best Answer

One can easily use the complement-rule here. Let $A$ denote the set of all possible arrangements. Let $A_1$ and $A_2$ $A_{1,2}$ denote the events that (respectively) bin 1 and 2 are empty. It should be clear that: $A= A_1 \cup A_2 \cup (A_1 \cup A_2)^c.$

It then follows that (because $A_1$, $A_2$ and $(A_1 \cup A_2)^c$ are disjunct and finitely countable):

$A= \vert A_1 \vert + \vert A_2\vert + \vert(A_1 \cup A_2)^c\vert$.

So it simply says, that the number of configurations without empty bins is all the configurations minus the (two) possible configurations with one empty bin (as it is impossible to have them both empty).