The question is like this:
In how many ways can 13 chocolate-chip cookies and 8 jelly donuts be distributed among four children that each child gets at least one cookies and one donuts?
The model answer of this question is:
${9+4-1 \choose 4-1}{4+4-1 \choose 4-1} = {12 \choose 3}{7 \choose 3} = 7700$
However, I cannot understand why using generating function method does not work:
$((x+x^2+...+x^{13-3})(x+x^2+...+x^{8-3}))^4$
where $13-3$ means every kid can at most get $10$ cookies as each of the others 3 kids need to get at least one.
With this method, I get an answer of $52020$ ways to do this.
So what is wrong with this method? I am really confused. Could anyone explain this to me?
Thanks in advance :D
Your generating function is a product of $8$ factors, and the products of terms making $x^{21}$ include things like this: $$x^1x^2x^3x^4x^5x^4x^1x^1=x^{21}\ .$$ The interpretation of this is that the children receive $1,2,3,4$ cookies and $5,4,1,1$ donuts, which is clearly not a valid solution to the problem.