1

I have a problem where I need to calculate how many different ways there are to select a number of bagels from a bagel shop which has 8 different kinds of bagels. I understand that if I want to calculate how many ways their are to choose for example, 12 bagels, I find:

C(n + k -1, k) or C(8 + 12 - 1, 12)

However, I do not understand how to calculate the number of ways to choose 12 bagels if for example, one must choose at least one of each kind or at least 3 of one kind and no more than 2 of another.

  • Do you know about generating functions? If not (or even if so) please tell us what we should assume you know, in order to give you a helpful answer. – rogerl Mar 08 '15 at 21:03
  • When we have to choose at least $1$ of each kind, then we first pick these, leaving $4$ choices for the remaining bagels (without constraints). So the answer to your first question should be $C(8+4-1,4)=C(11,4)$. – Uncountable Mar 08 '15 at 21:04
  • At least of the top of my head I don't know anything about generating functions. – James Hogle Mar 08 '15 at 21:05
  • @Uncountable

    That makes sense thank you! So for the second scenario, if I had to pick no more than lets say 2 of one kind, I could use that technique to calculate the number of ways to pick 0 of one kind, followed by 1, and then 2 and add them all together.

    – James Hogle Mar 08 '15 at 21:11

1 Answers1

0

This answer to the balls in boxes problem will be helpful possibly. As long as you know how many total bagels you are choosing, you can use the given formula to calculate the probability of any set of choices.

The different types of bagels the bagel shop offers represent the boxes. Your choices of bagels represent the balls. Say the shop has plain, veggie, and poppy seed ($n=3$ boxes), and you are to buy 5 bagels ($k=5$): 2 plain, 3 veggie. Then $b_0=1$, $b_1=0$, $b_2=1$, $b_3=1$, $a_1=3$, and $a_2=2$ should work with the formula. $$P\left(\{1,0,1,1\}\right)= \frac{\left( \begin{array}{c} 3\\ 1,0,1,1 \end{array} \right) \left( \begin{array}{c} 5\\ 3,2 \end{array} \right)}{3^5}=\frac{3\cdot 2\cdot 5\cdot 2}{3^5}=\frac{20}{3^4}.$$

jdods
  • 6,248