0

Question: Given a large supply of jelly beans of 10 different colors, how many ways are there to make up a bag of 5 jellybeans?

Answer: The answer is 14C9 or $\frac{14!}{(14-9)!9!}$ = 2002

I know that this is a combination problem with repetition, but I don't know why that is the answer. You are choosing 5 different colored jelly beans from 10 colors of jelly bean with replacement so shouldn't it be 14C5 ????

After all, the formula for the number of combinations with repetition allowed is:

$\frac{(n+r-1)!}{r!(n-1)!}$

Dom Turner
  • 201
  • 1
  • 7

1 Answers1

1

Ultrashort answer: 14C5 = 14C9.

This is a stars and bars problem. (Theorem 2 at the link)

You have nine bars $$ ||||||||| $$ The spaces before, between, and after the bars correspond to the ten colors (where the $\cdots$ represent other colors) $$ \text{orange}|\text{red}|\cdots|\cdots|\cdots|\cdots|\cdots|\cdots|\cdots|\text{black} $$ You distribute 5 stars among the bars, corresponding to a choice of numbers of jelly beans of the corresponding colors. For example $$ \ast \ast |\ast||||||||\ast\ast $$ represents two orange, one red, and two black jelly beans.

So the revised question is "How many ways to arrange these $n$ stars and $k-1$ bars are there?" (There are $k = 10$ colors, but only $k-1 = 9$ bars by fenceposting, by our use of the spaces between the bars to represent colors.) Well, there are $n+k-1$ objects and choosing the positions of the stars completely specifies the locations of the bars (and vice versa), so there are $\binom{n+k-1}{n} = \binom{n+k-1}{k-1}$ arrangements of stars and bars. For $n = 5, k = 10$, this gives $\binom{14}{5} = \binom{14}{9}$ different bags of five jellybeans from 10 colors.

Many people choose to remember the form $\binom{n+k-1}{k-1}$ because the "$-1$" is common to both arguments in the binomial coefficient. There is another way to represent this number using multinomial coefficients, but that is not your question.

Eric Towers
  • 67,037