2

Problem

Caleb's Cupcakes sells red velvet, vanilla cream and chocolate chip cupcakes. How many different combinations are possible for a dozen cupcakes at Caleb's?

I solved it by a distribution and finding all nonnegative solutions to $x+y+z = 12$. What is wrong with this method?

Puzzled417
  • 6,956

3 Answers3

1

Stars and Bars

There are several approaches. One is the Stars and Bars approach. This approach arranges $12$ stars and $2$ bars: $$ \overbrace{\star\star\star}^{\text{red velvet}}\mid\overbrace{\star\star\star\star\star}^{\text{vanilla cream}}\mid\overbrace{\star\star\star\star}^{\text{chocolate chip}} $$ Counting all possible arrangements of the stars and bars give all possible combinations of the types of cupcakes; i.e. $\binom{14}{2}=91$.


Generating Function

We can also develop the generating function of the number of combinations of $n$ cupcakes. Consider the product $$ \begin{align} &\overbrace{(1+x+x^2+x^3+\dots)}^{\text{red velvet}}\overbrace{(1+x+x^2+x^3+\dots)}^{\text{vanilla cream}}\overbrace{(1+x+x^2+x^3+\dots)}^{\text{chocolate chip}}\\[3pt] &=\frac1{(1-x)^3}\\[3pt] &=\sum_{n=0}^\infty\binom{-3}{n}(-x)^n\\ &=\sum_{n=0}^\infty\binom{n+2}{n}x^n\\ \end{align} $$ The coefficient of $x^n$ is the number of non-negative solutions to $a+b+c=n$, where $x^a$ is taken from the red velvet sum, $x^b$ is taken from the vanilla cream sum, and $x^c$ is taken from the chocolate chip sum. To see why $(-1)^n\binom{-3}{n}=\binom{n+2}{n}$, see this answer.

Setting $n=12$, we get $\binom{14}{12}=91$.

robjohn
  • 345,667
0

Well, if you correctly apply stars and bars, you get $\binom{12+3-1}{3-1} = 91$

0

The general answer is ${n+r-1\choose r-1}$ so plugging in $n=12,r=3$ we get $91$ so theres nothing wrong in your method only your application is wrong.