An examination contains four Question papers each paper carrying maximum marks as $m$. Find number of ways a student appearing for all the four papers gets a total of $2m$ Marks.
I used generating Polynomial method that is to find coefficient of $x^{2m}$ in
$$(1+x+x^2+\cdots+x^m)^4$$ which is
$$(1-x^{m+1})^4(1-x)^{-4}$$ which gives the coefficient of $x^{2m}$ as
$$\binom{2m+3}{3}-4 \times \binom{m+2}{m-1}$$
But the answer is just $\binom{2m+3}{3}$. What went wrong?
Let us consider the marks in all the $4$ papers as $a,b,c,d$; $0\le a,b,c,d\le m$
$$a+b+c+d=2m$$ Now we need to find the integer solution of the above equation in the given condition.
Number of solutions $=\dbinom{2m+4-1}{4-1}=\dbinom{2m+3}{3}$, but note that this also contains those solutions in which any variable is grater than $m$.
Hence we need to subtract those solutions for $a\ge m+1$ and let $t=a-(m=1),t\ge0$
$a+b+c+d=2m\implies t+b+c+d=m-1$.$$\dbinom{m-1+4-1}{4-1}=\dbinom{m+2}{3}$$and for $b\ge m+1,c\ge m+1, d\ge m+1$. Finally, $\dbinom{2m+3}{3}-4\times \dbinom{m+2}{3}$