[Math] Combinatorics: How many ways can 10 candy bars and 8 lollipops be given to five indistinct children

combinatorics

Could you please tell me if my answer correct?

Here is the problem:

How many ways can 10 candy bars and 8 lollipops be given to five nameless,
faceless, pitifully anonymous and altogether indistinct children so that every child gets at least one of each, but no child gets more than two lollipops?

Here is my answer:

First part of the problem: candy bars

As every indistinct children will receive at least one candy bar, the problem is equivalent to distribute five identical candy bars to five indistinct children. This problem is equivalent to answer the question how many integers partitions have the number 5?

We know that there are 7 partitions of 5:

5

4+1

3+2

3+1+1

2+2+1

2+1+1+1

and

1+1+1+1+1

Then the answer to the first part of the problem is 7.

Second part: lollipops

As every indistinct children will receive one or two lollipops, this problem is equivalent to answer the question how many integers partitions have the number 3, not allowing the partition {3}?

The only partitions are:

2+1 and

1+1+1

Thus the answer is 2.

Finally, by the multiplicative principle:

7*2 (7 ways to select the candy bars times 2 ways to select the lollipops).

Thus the final answer is 14.

Best Answer

Unfortunately, we approach directly by brute force. I do not see a more convenient approach. We break first into cases by candybar distribution, and then break down further based on lolipop distribution.

  • $5+0+0+0+0$

Either the person with six candybars does or does not get two lollipops: 2 options

  • $4+1+0+0+0$

Choose whether the person with 5 candybars does or does not get two lollipops and choose whether the person with 2 candybars does or does not get two lollipops. $4$ options

  • $3+2+0+0+0$

Similar to last case: $4$ options

  • $3+1+1+0+0$

Choose whether the person with 4 candybars does or does not get two lollipops. Then, choose whether one, both, or none of the persons with 2 candybars get two lollipops. Then, note that it is impossible for all three of them not to get two lollipops, so subtract one from the count to correct that: $2\cdot 3-1=5$ options

  • $2+2+1+0+0$

Similar to last case, choose for the person with 2 candybars, then choose how many people with 3 candybars for $5$ options.

  • $2+1+1+1+0$

Choose whether the person with 3 candybars does or does not get two lollipops. Then, choose whether the person with 1 candybar does or does not get two lollipops. $4$ options

  • $1+1+1+1+1$

Clearly only one option here.


We have then for a grand total $2+4+4+5+5+4+1=25$ options