Can someone explain the difference in the formula used for the following combination with repetition/replacement problems?
1) The local Dunkin' Donuts has thirty varieties of donuts. How many distinct ways can a box of a dozen donuts be filled?
The formula used was $\binom{n + r - 1}{r}$ here, and the answer was 12 -combinations of a 30-element set, with repetition/replacement. So $\binom{30+12−1}{12}$=7,898,654,920
2) How many solutions are there in the non-negative integers to the equation: $$x^1+x^2+x^3=11$$
Their solution: This amounts to drawing 11 balls from a bag of red, blue, and yellow balls, and counting the distinct combinations. So, 11 combinations of 3 elements give us $\binom{11+3-1}{11}$ = 78
Why does the formula for the second question have n as the denominator instead of r?