In how many ways can 9 different books and 17 identical cakes be divided on 6 children, so that each child receive at least one book and one cake

combinatoricsdiscrete mathematics

I'm trying to learn how to count but I'm having some problem.

The problem: In how many ways can $9$ different books and $17$ identical cakes be divided on $6$ (different) children, so that each child receive at least one book and one cake?

I got: The number of ways to divide $6$ different books on $6$ different children is the same as finding all surjective functions from a set $X$, with $|X|=9$ to set $Y$, where $|6|$. The number is $6!×S(9,6)$.

The number of ways to divide $17$ identical cakes on $6$ different children (here is where I am wrong) should in my mind be, after you give out one cake to each child, an unordered sequence with repetition: $\binom{11+6-1}6$. However this is wrong, the right answer here is $\binom{11+6-1}5$. Can someone please explain that last step to me?

Best Answer

In the stars-and-bars formulation of the second problem, there are $17$ stars (cakes), but only $5$ bars (children) to place in the $17-1=16$ spaces between adjacent stars, because those $5$ bars define $6$ partitions around them (before, between and after) which are identified with the $6$ children.

Then the number of ways to assign cakes to children is the same as the number of ways to choose, among the $16$ spaces, $5$ spaces to hold the bars, hence $\binom{11+6-1}5$ and not $\binom{11+6-1}6$.