How many solutions does the equation $a + b + c + d + e = 21$ have in the nonnegative integers if $a \leq 3$, $0 < b < 4$, and $c \geq 15$? How many solutions are there to the equation in the nonnegative integers:
$$a+b+c+d+e = 21$$
Conditions:
a) $ a \le 10$
I understood the solution which is total number of possibilities - the number of possibilities with $a \gt 10$ which is $\binom{5+21-1}{21} - \binom{5+10-1}{10}$.
b) $a \le 3$, $0 \lt b \lt 4$, $c \ge 15$.
How do I solve this part? Thanks in advance. 
 A: If you don't mind, I'll solve this with generating functions. We represent the different choices for each letter as a power series, where the coefficient represents the allowed numbers. In your case, $a$ will be represented by $(1+x+x^2+x^3)$ since it can be $0,1,2,3$, similarly $b$ will be $(x+x^2+x^3)$ , $c$ will be $\sum_{k=15}^\infty x^k = x^{15}\sum_{k=0}^\infty x^k$, and $d$ and $e$ will be $\sum_{k=0}^\infty x^k$ since they can be anything. Now, when we multiply these power series together, for every way that we can choose a term from the letters and make the power $21$, we will add $1$ to the coefficient of $x^{21}$ in the product power series. 
To convince yourself that this works, you could look at the generating function $(1+x)^n = \sum_{k=0}^n\binom{n}kx^k$. This is like having $n$ letters that can be $0$ or $1$, and the coefficient of $x^k$ in the product power series is the number of ways which you can write $k$ as sum of $0$s and $1$s, which is just the number of ways which you can choose which $k$ of the $n$ variables to take on the value $1$. 
Now, our product series is
\begin{align*}
(1+x+x^2+x^3)x(1+x+x^2)x^{15}\left(\sum_{k=0}^\infty x^k\right)\left(\sum_{k=0}^\infty x^k\right)^2 &= x^{16}\frac{1-x^4}{1-x}\frac{1-x^3}{1-x}\frac1{(1-x)^3} \\
&= \frac{x^{16}(1-x^4)(1-x^3)}{(1-x)^5}.
\end{align*}
So, we want the coefficient of $x^{21}$ of the power series expansion of the above, which is just the coefficient of $x^5$ in the expansion of
$$
\frac{(1-x^4)(1-x^3)}{(1-x)^5} = (1-x^3-x^4+x^7)\sum_{k=0}^\infty\binom{k+4}4 x^k.
$$
The relevant terms come from $1\cdot\binom{5+4}4 x^5$, $-x^3\cdot\binom{2+4}4 x^2$, $-x^4\cdot\binom{1+4}4 x$, so your answer is
$$
\boxed{\binom{5+4}4-\binom{2+4}4-\binom{1+4}4.}
$$
Please let me know if I have made any mistakes. 
A: We wish to find the number of solutions in the nonnegative integers of the equation 
$$a + b + c + d + e = 21 \tag{1}$$
subject to the restrictions $a \leq 3$, $0 < b < 4$, and $c \geq 15$.  Since $b$ is an integer, the restriction $0 < b < 4$ is equivalent to the restriction $1 \leq b \leq 3$.  
We first address the restrictions $b \geq 1$ and $c \geq 15$.  Let $b' = b - 1$ and $c' = c - 15$.  Then $b'$ and $c'$ are nonnegative integers.  Substituting $b' + 1$ for $b$ and $c' + 15$ for $c$ in equation 1 yields
\begin{align*}
a + b' + 1 + c' + 15 + d + e & = 21\\
a + b' + c' + d + e & = 5 \tag{2}
\end{align*}
Equation 2 is an equation in the nonnegative integers with 
$$\binom{5 + 5 - 1}{5 - 1} = \binom{9}{4}$$
solutions.  
From these, we must subtract those cases in which $a > 3$ or $b > 3$.  Observe that the restriction $b > 3 \implies b' = b - 1 > 2$.  Notice also that since $4 + 3 = 7 > 5$, these two conditions cannot be violated simultaneously.
Suppose $a > 3$.  Let $a' = a - 4$.  Then $a'$ is a nonnegative integer.  Substituting $a' + 4$ for $a$ in equation 2 yields
\begin{align*}
a' + 4 + b' + c' + d + e & = 5\\
a' + b' + c' + d + e & = 1 \tag{3}
\end{align*}
Equation 3 is an equation in the nonnegative integers with 
$$\binom{1 + 5 - 1}{5 - 1} = \binom{5}{4}$$
solutions.
Suppose $b' > 2$.  Let $b'' = b' - 3$.  Then $b''$ is a nonnegative integer.  Substituting $b'' + 3$ for $b'$ in equation 2 yields
\begin{align*}
a + b'' + 3 + c' + d + e & = 5\\
a + b'' + c' + d + e & = 2 \tag{4}
\end{align*}
Equation 4 is an equation in the nonnegative integers with 
$$\binom{2 + 5 - 1}{5 - 1} = \binom{6}{4}$$
solutions.  
Hence, the number of solutions of equation 1 subject to the restrictions $a \leq 3$, $0 < b < 4$, and $c \geq 15$ is 
$$\binom{9}{4} - \binom{5}{4} - \binom{6}{4}$$    
A: Put $b=1+b'$, $c=15+c'$. Then we have to count the nonnegative solutions of
$$a+b'+c'+d+e=5\tag{1}$$
satisfying $a\leq3$, $b'\leq2$. Denote by $n_r$ the number of admissible pairs $(a,b')$ with $a+b'=r$. By stars and bars the total number $N$ of admissible solutions of $(1)$ is then given by
$$N=\sum_{r=0}^5n_r\cdot{7-r\choose 2}=1\cdot21+2\cdot15+3\cdot10+3\cdot6+2\cdot3+1\cdot1=106\ .$$
