10 apples and 20 pears need to be distributed among 6 people such that every person ends up with at least one piece of fruit.
I understand (and have solved) a problem where, for example, every person gets at least one apple, but I'm not sure how to express the fact that it doesn't matter here. I've tried solving it multiple ways which turned out to be completely illogical compared to the official solution.
In the book, I'm instructed to use the inclusion-exclusion principle:
$\sum_{i=0}^5(-1)^i\binom{6}{i}\overline{C}_{6-i}^{10}\overline{C}_{6-i}^{20}$
Which boils down to (combinations with repetition are marked as $\overline{C} $ in my book):
$\sum_{i=0}^5(-1)^i\binom{6}{i}\binom{10+6-i-1}{6-i}\binom{20+6-i-1}{6-i}$
I would be grateful if somebody could help me understand the logic behind this solution. I've tried somehow visualizing this while calculating it, but I still don't quite understand why I'm using this approach. Thank you in advance.
$\overline{\mathrm C}^{n}_{r}$ counts the ways to distribute $n$ fruit among $r$ people. That is: $\binom{n+r+1}{r}$
Likewise $\overline {\mathrm C}^{10}_{6-i}\overline {\mathrm C}^{20}_{6-i}$ counts the ways to distribute 10 apples and 20 pears among $6-i$ people.
${\mathrm C}^6_{6-i}$ or $\binom 6{i}$ counts ways to select those $6-i$ people from $6$.
However, those counts do not exclude those where some of the selected people receive no fruit. So to properly count way to distribute the fruit among six people who so all receive at least one fruit we use exclusion and inclusion:
$$\sum_{i=0}^5 (-1)^i {\mathrm C}^6_{6-i}\overline{\mathrm C}^{10}_{6-i}\overline{\mathrm C}^{20}_{6-i}$$