Number of combinations of 12 donuts with 8 choices of flavor with restrictions (at least and at most) I'm working on a homework of combinatorics for a discrete math course. Please excuse any mistakes on my writing, English isn't my first language.
I already did all the problem, but there's obviously overcounting in my steps. I would like to know where I made a mistake.
So, I have a problem where I need to calculate the possible combinations for different contexts on the selection of 12 donuts out of 8 flavors with repetitions allowed. I browsed some questions on the website, but they all seem a bit too complicated for my specific problem, and as mentioned, I already answered the questions, but the last one seems not right.
First question : What is the number of possible combinations of 12 donuts out of 8 flavors, repetitions allowed? 
Simple, I used the method which I think is called "Stars and bars" used on many topics from the website which is defined in my book by : 
$C(k + t - 1, t - 1)$
where :
$X$ = a set containing the choices (flavors in our case)
$k$ = the number of selected Items from X (the dozen of donuts)
$t$ = $\Vert$X$\Vert$
So it gives me $C(12 + 8 - 1, 8 - 1) = C(19, 7) = 50388$
Second question :
I need the number of combinations where there is at most 2 vanilla donuts and at least 3 strawberry donuts.
Here, I calculated the combinations of $2$ donuts from $8$ flavors, so I'll have at most $2$ vanilla donuts :
$C(2 + 8 - 1, 8 - 1) = C(9, 7) = 36$
Then, $7$ other donuts from $7$ flavors (removed the vanilla flavor) :
$C(7 + 7 - 1, 7 - 1) = C(13, 6) = 1716$
Finally, the 3 others that needs to be strawberry :
$1$ combination only.
So, by the multiplication principle, I'll have $36*1716*1 = 61776$ combinations, which is more than the first question, but with restrictions, which isn't logic.
Could you please point me my mistake? Thanks to anyone who takes time to read and/or reply.
 A: Your answer to the first part is correct.
To answer the second part, assume that vanilla and strawberry are two of the eight flavors, and the other six flavors are distinct from these and from each other.  Moreover, assume without loss of generality that the first grouping of stars corresponds to the vanilla flavor and the second grouping of stars is the strawberry.
Then the placement of the first bar must be among the first three symbols overall:  that is to say, we can have $$(\; | \ldots), \quad (\, * \, | \ldots), \quad (\, * * | \ldots).$$  The placement of the second bar must be after at least three stars are placed after the first bar.  So the possible arrangements are now $$(\; | * * *  \ldots), \quad (\, * \, | * * * \ldots), \quad (\, * * | * * *  \ldots).$$  There are no other restrictions:  in each of the above three cases, any placement of stars and bars following the symbols is allowed so long as the correct remaining numbers of stars and bars are used.  In the first case, there are $6$ bars and $9$ stars remaining, so there are $\binom{15}{6} = 5005$ such arrangements.  In the second, there are $6$ bars and $8$ stars remaining, with $\binom{14}{6} = 3003$ arrangements.  And in the third, there are $6$ bars and $7$ stars remaining, with $\binom{13}{6} = 1716$ arrangements, for a total of $9724$ desired arrangements satisfying the given criteria.
Why did your method of solution not work?  Ultimately, the reason is that you cannot perform the enumeration separately for the individual flavors because they don't occur independently.  The stars represent donuts, and the bars represent divisions between donuts of different flavors.
A: You solved the first question correctly.
Let $x_s$ denote the number of strawberry donuts selected; let $x_v$ denote the number of vanilla donuts selected.  Since a dozen donuts are selected from the eight flavors, including at least three strawberry and at most two vanilla, we must determine the number of solutions of the equation 
$$x_s + x_v + x_3 + x_4 + x_5 + x_6 + x_7 + x_8 = 12 \tag{1}$$
in the nonnegative integers subject to the restrictions that $x_s \geq 3$ and $x_v \leq 2$.  
Since $x_s \geq 3$, $x_s' = x_s - 3$ is a nonnegative integer.  Notice that $x_s'$ represents the number of additional strawberry donuts that may be selected after three strawberry donuts are placed in the box.  Substituting $x_s' + 3$ for $x_s$ in equation 1 yields
\begin{align*}
x_s' + 3 + x_v + x_3 + x_4 + x_5 + x_6 + x_7 + x_8 & = 12\\
x_s' + x_v + x_3 + x_4 + x_5 + x_6 + x_7 + x_8 & = 9 \tag{2}
\end{align*}
Equation 2 represents the number of ways we may select nine additional donuts once three strawberry donuts have been selected (we will address the restriction that $x_v \leq 2$ later).  Equation 2 is an equation in the nonnegative integers.  A particular solution of equation 2 corresponds to the placement of seven addition signs in a row of nine ones.  For instance,
$$1 1 + 1 1 1 + 1 + 1 1 + + 1 + +$$
corresponds to the (prohibited) choice $x_s' = 2$ ($x_s = 5$), $x_v = 3$, $x_3 = 1$, $x_4 = 2$, $x_5 = 0$, $x_6 = 1$, $x_7 = 0$, $x_8 = 0$.  The number of solutions of equation 2 in the nonnegative integers is 
$$\binom{9 + 8 - 1}{8 - 1} = \binom{16}{7}$$
since we must select which seven of the sixteen positions required for nine ones and seven addition signs will be filled with addition signs.
From these, we must subtract those selections in which $x_v > 2$.  Suppose $x_v > 2$.  Then $x_v' = x_v - 3$ is a nonnegative integer.  Substituting $x_v' + 3$ for $x_v$ in equation 2 yields
\begin{align*}
x_s' + x_v' + 3 + x_3 + x_4 + x_5 + x_6 + x_7 + x_8 & = 9\\
x_s' + x_v' + x_3 + x_4 + x_5 + x_6 + x_7 + x_8 & = 6 \tag{3}
\end{align*}
Equation 3 is an equation in the nonnegative integers with
$$\binom{6 + 8 - 1}{8 - 1} = \binom{13}{7}$$
solutions.  
Hence, the number of selections of a dozen donuts from eight flavors that include at least three strawberry and at most two vanilla is
$$\binom{16}{7} - \binom{13}{7}$$ 
