2958701

Nine different chocolate bars are to be distributed to 3 different kids.

https://math.stackexchange.com/questions/2958701/combinatorics-question-involving-distributing-9-different-candies-to-three-diffe

a) In how many ways can this be done if there are no restrictions?

b) In how many ways can this be done if the child A receives exactly four chocolate bars?

c) In how many ways can this be done if each kid gets at least one chocolate bar?

a) the species formula is $$E(X).E(X).E(X)$$;

the $$ egf = exp(x)^3 $$ and the coefficient of $$ x^9 = 19683 $$

b) the species formula is

$$E_4(X).E(X).E(X)$$;

the $$egf = {x^4 \over 4!}*exp(x)^2$$ and the coefficient of $$x^9 = 4032$$

c) the species formula is $$E^+(X).E^+(X).E^+(X)$$;

the $$egf = (exp(x)-1)^3$$ and the coefficient of $$x^9 = 18150$$

If we want to obtain the three numbers above in a more "terrestrial" way, we will have to consider the generating functions :

a) $$GF = (1+x+x^2+...+x^9)^3$$ and the coefficient of $$x^9 = 55$$

b) $$GF = x^4(1+x+x^2+...+x^9)^2$$ and the coefficient of $$x^9 = 6$$

c) $$GF = (x+x^2+...+x^9)^3$$ and the coefficient of $$x^9 = 28$$

The number shows types of distribution. For example, that there are $$55$$ ways to express $$9$$ as a sum of three terms

$$9=0+0+9, \ \ 9 = 0+1+8, \dots$$, order matters.

For each of the 55 types we have to compute the distribution, eg. for 9 = 2+3+4 we have to take into account $$\binom {2+3+4}{2,3,4}$$

Then we sum all the 55 (or 6, or 28) numbers.