In how many ways can four (different) people be given $5$ different prizes and $7$ identical candy bars so that each person gets something?
I think that the answer is:
- $A_0 =$ we distribute all things between $4$ persons
- $A_1 =$ one person doesn't get anything (we distribute all things between $3$ persons)
- $A_2 =$ two presons don't get anything (we distribute all things between $2$ persons)
- $A_3 =$ three persons don't get anything (so one person gets all things)
$$|A_0| - |A_1 \cup A_2 \cup A_3| = |A_0| - |A_1| - |A_2| - |A_3| + |A_1 \cap A_2| + |A_1 \cap A_3| + |A_2 \cap A_3| - |A_1 \cap A_2 \cap A_3|$$
$$|A_0| - |A_1 \cup A_2 \cup A_3| = |A_0| - |A_1| - |A_2| - |A_3| + |A_2| + |A_3| + |A_3| - |A_3| = |A_0| - |A_1|$$
$$|A_0| - |A_1 \cup A_2 \cup A_3| = |A_0| - |A_1| = {{7}\choose{4}} \cdot 4^5 - \left( {{7}\choose{3}} \cdot 3^5 \right) \cdot 4$$
$A_0$ = first we choose ways to group 7 identical candy bars between 4 persons, then we choose which prize goes to which person in group of 4.
$A_1$ = first we choose ways to group 7 identical candy bars between 3 persons, then we choose which prize goes to which person in group of 3. At the end we choose person that doesn't get anything in 4 ways.
$$|A_0| - |A_1 \cup A_2 \cup A_3| = |A_0| - |A_1| = \frac{7!}{4! \cdot 3!} \cdot 4^5 - \frac{7!}{4! \cdot 3!} \cdot 3^5 \cdot 4 = (1024 - 972) \frac{7!}{4! \cdot 3!} = 52 \frac{7!}{4! \cdot 3!} = 52 \cdot 35 = 1820$$
Is that correct?
You have the right general idea: count the complement using inclusion-exclusion principle. But there are some problems with your calculation, as you are missing accounting for cases in which more than one specific person receive no items. Also, there is a small issue in your count for the number of ways to distribute the candy bars. You can check here for more information.
Call the four people $A$, $B$, $C$, and $D$.
(I) We first compute the number of ways that $(A)$, specifically, does not receive anything. This is easy enough: there are $3^5$ ways to distribute the prizes, and $\binom{7 + 3 - 1}{3 - 1} = \binom{9}{2}$ ways to distribute the candies, for a total of $3^5 \binom{9}{2}$. By symmetry, this is also the number of ways that $(B)$, $(C)$, or $(D)$, individually, receive nothing. There are $4$ of these cases.
(II) Now, we compute the number of ways that $(A, B)$, specifically, do not receive anything. By the same idea as above, this is done in $2^5 (8)$ ways. Now we must ask ourselves, for each of these ways, how many of these were counted in (I) above? Well, one was counted as part of $A$ receiving nothing, and the other was counted as part of $B$ receiving nothing. So, we have overcounted by one times this number of ways, so we will subtract one times $2^5 (8)$ from the total count. By symmetry, this is also the number of ways that $(A, C)$, $(A, D)$, $(B, C)$, $(B, D)$, and $(C, D)$ receive nothing. There are $6$ of these cases.
(III) Finally, we compute the number of ways that $A$, $B$, and $C$ receive nothing. Simple enough: there is just $1$ way to give everything to $D$. How many times has this case been counted before? In (I), this case was counted $3$ times. In (II), this case was discounted $3$ ways. So, we have not counted this case at all, and so add one times $1$ to the final count. By symmetry, this is also the number of ways that $(A, B, D)$, $(A, C, D)$, and $(B, C, D)$ receive nothing. There are $4$ of these cases.
In total, the number of ways that at least one person does not receive anything is
$$4 (3^5) \binom{9}{2} - 6 (2^5) (8) + 4 = 33460$$
The total number of ways to distribute without regard for how many items each person gets is
$$4^5 \binom{7 + 4 - 1}{4 - 1} = 4^5 \binom{10}{3} = 122880$$
So, the desired number of ways in which each person receives something is
$$122880 - 33460 = \boxed{89420}$$