In how many ways a student can get $2m $ Marks 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?
 A: 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}$
A: Nothing went wrong. Your answer is correct.

Somewhat more detailed we obtain by using the coefficient of operator $[x^n]$ to denote the coefficient of $x^n$ in a series:
  \begin{align*}
\color{blue}{[x^{2m}]}&\color{blue}{(1+x+\cdots+x^m)^4}\\
&=[x^{2m}]\left(\frac{1-x^{m+1}}{1-x}\right)^4\\
&=[x^{2m}]\left(1-4x^{m+1}\right)\sum_{j=0}^\infty\binom{-4}{j}(-x)^j\tag{1}\\
&=\left([x^{2m}]-4[x^{m-1}]\right)\sum_{j=0}^\infty\binom{j+3}{3}x^j\tag{2}\\
&\,\,\color{blue}{=\binom{2m+3}{3}-4\binom{m+2}{3}[[m\geq 1]]}\tag{3}
\end{align*}

Comment:


*

*In (1) we expand the numerator up to powers of $x^{m+1}$ since higher powers do not contribute to $x^{2m}$ and we use the binomial series expansion.

*In (2) we use the linearity of the coefficient of operator and apply the rule $[x^{p-q}]A(x)=[x^p]x^qA(x)$. We also use the binomial identity $\binom{-p}{q}=\binom{p+q-1}{q}(-1)^q$.

*In (3) we select the coefficients accordingly. We also use the Iverson brackets to respect that the exponent in $[x^{m-1}]$ is non-negative.
