Combinatorics / Inclusion-Exclusion Principle I have this problem:
A bakery sells $4$ varieties of donuts but there are only $6$ chocolate and $7$ glazed.
How many ways can we buy $12$ donuts if the selection must include at least $3$ glazed donuts (order is irrelevant)?
In my attempt, I first subtracted the $3$ glazed we have to include then used stars and bars to find the number of ways assuming unlimited amounts of everything: $12-3 = 9$ spots to fill, with $4$ varieties $= {12\choose9} = 220$ ways.
From here I was thinking we can subtract the number of ways that include more than the amounts we have, e.g., the ways that have $7$, $8$, or $9$ chocolate donuts and the ways that have $5$, $6$, $7$, $8$, or $9$ glazed donuts.
However, I'm not sure if this is the best way to approach this? I don't really understand where the inclusion-exclusion principle would be involved.
 A: The question implies that there are at least $12$ donuts of each of the other varieties available.
If we select three glazed donuts to begin with, then we must select nine more donuts from the six chocolate, four glazed, and unlimited (for our purposes) number of the other two varieties available.  The number of ways we can do this is the number of solutions of the equation
$$a + b + c + g = 9 \tag{1}$$
in the nonnegative integers subject to the restrictions that $c \leq 6$ and $g \leq 4$.
A particular solution of equation 1 corresponds to the placement of $4 - 1 = 3$ addition signs in a row of nine ones.  For instance,
$$1 1 1 + 1 1 1 1 + 1 1 +$$
corresponds to the solution $a = 3$, $b = 4$, $c = 2$, $g = 0$.  The number of such solutions is
$$\binom{9 + 4 - 1}{4 - 1} = \binom{12}{3}$$
since we must select which $4 - 1 = 3$ of the $9 + 4 - 1 = 12$ positions required for $9$ ones and $4 - 1 = 3$ addition signs will be filled with addition signs, as you found.
From these, we must subtract the number of solutions in which $c > 6$ or $g > 4$.  Notice that these restrictions cannot be violated simultaneously since $7 + 5 = 12 > 9$.
Suppose the restriction that $c \leq 6$ is violated.  Then at least seven chocolate donuts must be placed in the box.  Let $c' = c - 7$.  Then $c'$ is a nonnegative integer.  Substituting $c' + 7$ for $c$ in equation 1 yields
\begin{align*}
a + b + c' + 7 + g & = 9\\
a + b + c' + g & = 2 \tag{2}
\end{align*}
Equation 2 is an equation in the nonnegative integers with
$$\binom{2 + 4 - 1}{4 - 1} = \binom{5}{3}$$
solutions.
Suppose the restriction that $g \leq 4$ is violated.  Then at least five additional glazed donuts must be placed in the box.  Let $g' = g - 5$.  Then $g'$ is a nonnegative integer.  Substituting $g' + 5$ for $g$ in equation 1 yields
\begin{align*}
a + b + c + g' + 5 & = 9\\
a + b + c + g' & = 4 \tag{3}
\end{align*}
Equation 3 is an equation in the nonnegative integers with
$$\binom{4 + 4 - 1}{4 - 1} = \binom{7}{3}$$
solutions.
Hence, the number of ways to select $12$ donuts, of which at least three are glazed, from the four varieties given the restrictions that only six chocolate and seven glazed donuts are available is
$$\binom{12}{3} - \binom{5}{3} - \binom{7}{3}$$
