# Grabbing a handful of donuts given 4 different flavors

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?

• "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." Since we're talking about the number of different handfuls, this does not matter. – Umer Amjad Mar 7 '18 at 1:59
• @lil Yes, you may ask me about combinatorics problems in a chatroom. – N. F. Taussig May 1 '18 at 0:05
• how do I invite you to a chat? – Lil May 1 '18 at 0:06
• thank you very much for your help! – Lil May 1 '18 at 0:06
• @lil I did not see your message since you did not place an at symbol before my name. Based on what I read in the help center, you may need a higher reputation than you currently have to open a private chat room. That said, you can start asking your question here. In my experience, after we exchange a certain number of messages, we will be warned not to hold private conversations in the comments and the site will ask us if we want to move our conversation to a chat room. – N. F. Taussig May 1 '18 at 1:04

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$.

• I meet another person who spells doughnuts the same way as I do. – user535339 Mar 7 '18 at 2:01
• Lets say for instance I only had 4 glazed munchkins total but still wanted to grab 8.Again that would give me cases to remove. Would that still be one bad case to remove or more? because I can't grab 5,6,7, or 8 glazed munchkins. So would I remove 4 bad cases? – Lil Mar 7 '18 at 2:08
• @Lil In that case, you also have to remove the cases with 7 glazed, 6 glazed and 5 glazed. That makes four cases to remove in total. Each of the further cases can be tackled using stars and bars too, by cutting out the glazed doughnuts from consideration in the selection (so for five glazed, you would consider selections of three from the other three types of doughnuts). – Parcly Taxel Mar 7 '18 at 2:11
• ok thank you! and removing the cases with 8,7,6,and 5 to make 4 right? – Lil Mar 7 '18 at 2:14
• @Lil yes.${}{}$ – Parcly Taxel Mar 7 '18 at 2:15

$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$

• Please read this tutorial on how to typeset mathematics on this site. – N. F. Taussig Mar 7 '18 at 2:03
• Lets say for instance I only had 4 glazed munchkins total but still wanted to grab 8.Again that would give me cases to remove. Would that still be one bad case to remove or more? because I can't grab 5,6,7, or 8 glazed munchkins. So would I remove 4 bad cases? – Lil Mar 7 '18 at 2:08
• in this case, number of cases to be removed are more, hence it is easier to define a new variable y4 = 4+1 +x4 { 4 because you have 4 glazed munchkin here, 1 because of adjusting with non-negativity } . now you have to find the number of non-negative integral solution to x1+x2+x3+ y4 = 8-4-1 = 3 , and then remove the number of cases from total – cyberboy Mar 7 '18 at 2:23
• @N.F.Taussig May I ask you a few combinatorics problems in a private chat? – Lil Apr 30 '18 at 22:13
• @N.F.Taussig I have started solving a problem 3 different methods but have obtain 3 different answers two of which are very close but I'm not sure which to trust – Lil Apr 30 '18 at 22:13