Grabbing a handful of donuts given 4 different flavors

97 Views Asked by At

A student's teacher decided to bring donuts to class the day before break. In the teacher's munchkin box are 18 chocolate munchkins, 12 cinnamon munchkins, 14 powdered munchkins, and 7 glazed munchkins. The student grabs a handful of 8 munchkins.

How many different handfuls could the student have grabbed?

Since the munchkins of each flavor are identical I was thinking of using the stars and bars approach but I'm a little confused what to do with the number of each type.

Originally I was thinking there would be 3 bars to account for the 4 different donut types and $8$ stars to account for the handful of 8 munchkins taken by the student. However since there are a lot of chocolate munchkins the student will be more likely to grab more chocolate munchkins and my approach doesn't take this detail into consideration. Can someone help give me a hint on how to approach this question?

2

There are 2 best solutions below

6
On

Stars and bars will work just fine. Assuming there are unlimited supplies of each type of doughnut, you get $\binom{8+3}3=165$ selections.

However, note that there are only seven glazed doughnuts, so we cannot have a selection of eight glazed doughnuts. All other selections are possible because there are at least eight of the other three types of doughnuts, so the correct number of selections the student can make is $165-1=164$.

6
On

$x_1 + x_2 + x_3 + x_4 = 8$

$0 \le x_1 \le 18$

$0 \le x_2 \le 12$

$0 \le x_3 \le 14 $

$0 \le x_4 \le 7 $

the limit $(18,12,14,7)$ are important only in case it is less than the sum required ($8$ here)

so first three inequalities don't matter.

Now if there had been no constraint on $x_4$, then the number of non-negative integral solution of: $$x_1+x_2+ ... + x_k = n$$ is $(n+k-1)C(k-1)$

Here $n = 8$, $k = 4 $, hence $11C3 = 165$
now due to limit in $x_4$ , only case left in the above solution is $(0,0,0,8) $

hence required number = $164 $