<s>[INST] Number of solutions in non-negative integers question (Stars and bars) Q How many solutions are there in non-negative integers $a, b
, c, d$ to the equation:
$$ a + b + c + d = 79 $$
with the restrictions that $a \geq 10$, $b \leq 40$ and $20 \leq c \leq 30?$
If anyone could point me to any notes regarding the topic that would be greatly appreciated. 
 [/INST] Using generating functions, we want to find the coefficient of $x^{79}$ in the product
$\displaystyle(x^{10}+x^{11}+x^{12}+\cdots)(1+x+\cdots+x^{40})(x^{20}+x^{21}+\cdots+x^{30})(1+x+x^2+\cdots)$
$\displaystyle=\left(\frac{x^{10}}{1-x}\right)\left(\frac{1-x^{41}}{1-x}\right)\left( x^{20}\cdot\frac{1-x^{11}}{1-x}\right)\left(\frac{1}{1-x}\right)=x^{30}\cdot\frac{(1-x^{41})(1-x^{11})}{(1-x)^4}$.
Therefore we need to find the coefficient of $x^{49}$ in
$\displaystyle\left(1-x^{11}-x^{41}+x^{52}\right)\sum_{n=0}^{\infty}\binom{n+3}{3}x^n$, which is given by$\displaystyle\binom{52}{3}-\binom{41}{3}-\binom{11}{3}$
</s>