Find the generating function for the number of integer solutions to $x_1 + x_2 + x_3 + x_4 = r$ with $1 \le x_1 \le x_2 \le x_3 \le x_4$.
The textbook has showed me the solution, so I do know how to do this (If someone need it, I will update)
But before I saw the solution, I constructed my own way which 'seemed' to be wrong, but I couldn't see where the mistake was, which step led to the incorrect generating function usage, so please point out the mistake I made :) :
First, let
$y_1 = x_1\\y_2 = x_2 - x_1\\ y_3 = x_3 - x_2\\ y_4 = x_4 - x_3\\ y_5 = r - x_4$
thus $y_1 + y_2 + y_3 + y_4 + y_5 = r$
where $y_1 \ge 1,\ y_2, y_3, y_4 \ge 0,\ y_5 \ge 3$
So, the generating function can be constructed:
$A(x) = (x + x^2 + x^3 + ...)(1 + x + x^2 + ...)^3(x^3 + x^4 + x^5 + ...)\\ = x(1 + x + x^2 + ...)(1 + x + x^2 + ...)^3x^3(1 + x + x^2 + ...)\\= x^4(1 + x + x^2 + ...)^5\\ = x^4(\frac{1}{1-x})^5 = x^4(\sum_{n=0}^\infty\ {{4 + n}\choose{4}}x^n)$
The coefficient of $x^r$ is ${{4 + r-4}\choose{4}} = {{r}\choose{4}}$
If $r = 6$, from my generating function, there are ${{6}\choose{4}} = 15$ solutions, which seemed wrong, because the solution can only be $1 + 1 + 1 + 3 = 6$ or $1 + 1 + 2 + 2 = 6$
Thanks!