How many solutions are $ a+b+c+d+e = 10 $ I would appreciate if somebody could help me with the following problem: 
Q: How many solutions are 
there to the equation 
$$ a+b+c+d+e = 10 $$
where $a,b,c,d,e\in \{0,1,2,3,4\}$ 
 A: Can you find the coefficient of the $10^{\text{th}}$ degree term in this polynomial?
$$p(x)=(1+x+x^2+x^3+x^4)^5=\frac{(x^5-1)^5}{(x-1)^5}$$
A: Outline of a solution:


*

*Find all integer partitions of $10$ into at most $5$ elements with maximal value $4$.

*For each such partition, compute the number of distinct permutations of the elements.

A: This is a typical combinatorial problem. Imagine you have five varieties of pastries $a,b,c,d,e$ and you have to make up a box of $10$ pastries with the condition that you cannot make use of more than $4$ of each variety.
First think of it without this restriction of no more than $4$ of each variety.
Without this restriction this can be thought of as the number of ways to arrange $10$ zeros and $4$ ones. You may think of each one as a divider between the zeros. For example, $00100010000110$  means you have created a box of $10$ pastries with $2$ of type $a$, $3$ of type $b$, $4$ of type $c$, none of type $d$ and $1$ of type $e$. 
So the number of pastry boxes = number of binary strings of length $14$ with exactly $10$ zeros (or same as exactly $4$ ones). and this is equal to $\binom{14}{10}$. 
Once you get this then you need to subtract the number of solutions possible when at least one of the variables is $\geq 5$ and so on.
A: We outline the strategy, and leave it to you to put the pieces together. 
You are probably familiar with the number of solutions of $a+b+c+d+e$ in non-negative integers. This is solved by a technique often called Stars and Bars. For the record, the number is $\binom{14}{4}$. 
We need to take away from this the number of solutions where one or more of the variables is $\ge 5$. 
The solutions where one of the numbers is $\ge 6$ are easy to count. There are $5$ ways to choose which of $a,b,c,d,e$ is $\ge 6$. And given that (say) $a\ge 6$, the number of solutions is the number of solutions of $a+b+c+d+e$ in non-negative integers. That's a Stars and Bars problem. 
Now we count the solutions where one or more of the variables is equal to $5$. There are $\binom{5}{2}$ solutions where two of the numbers are $5$. 
For exactly one of the numbers equal to $5$, things are more complicated. Which one it is can be chosen in $5$ ways. Then we need to solve $x+y+z+w=5$, with none of the entries equal to $5$. This is the number of solutions in non-negative integers of $x+y+z+w=5$, minus the $4$ solutions in which one of the variables is $5$. 
