Let $x_1+x_2+x_3=5$ and $1 \leq x_1 \leq 4$ , $0 \leq x_2 \leq 4$ , $0 \leq x_3 \leq 4$ .
How many $x_1$, $x_2$, and $x_3$ are there?
Firstly i found the all cases such that $C (4+3-1,4)=15$ but i stuck in the rest.I could not make inclusion exclusion part. Can you help me? The correct answer is $14$.
You can use a generating function. The answer is the coefficient of $x^5$ in $$(x+x^2+x^3+x^4)(1+x+x^2+x^3+x^4)^2,$$ which is the coefficient of $x^4$ in $$(1+x+x^2+x^3)(1+x+x^2+x^3+x^4)^2.$$ Expanding yields $$1+3x+6x^2+10x^3 + 14x^4 +\cdots,$$ so the answer is $14.$