Distributing 2 different kinds of identical objects into 4 distinct groups

534 Views Asked by At

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

2

There are 2 best solutions below

3
On

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.

0
On

Expanding the comment of the OP on the answer of @David, you can use this generating function

$$f(x,y)=((x+x^2+...+x^{13-3})(y+y^2+...+y^{8-3}))^4$$

and after search the coefficient for $x^{13}y^8$.

Anyway see that you have 2 independent distributions combined into one: the distribution of chocolate and the distribution of donuts.