How many ways are there to distribute 12 identical candies among 5 children with each child having at most 5 candies?

Guest Jan 1, 2023

#2**+2 **

Let the children be a, b, c, d, and e since they are different.

a + b + c + d + e = 12. By stars and bars if each variable is nonnegative, we have (12 + 5 - 1 choose 5 - 1) = 16 choose 4 = 1820 ways.

However we overcounted the ways for when the variables are more than 5. But these cases are easy to count:

Case 1: There was a 6.

a + b + c + d = 6. Stars and bars = 9 choose 3 = 84 ways, multiply this by 5 to get the cases when d, c, b, and a are 6 = 420 ways.

Case 2: There was a 7.

...

Then once you finish up the cases, all you have to do is take 1820, and subtract the overcounts. (The answer is not >1400)

proyaop Jan 1, 2023