The number of flavor profiles created?

38 Views Asked by At

If someone wants to make a batch of "n" cherry pies and wants to use 16 cherries to make the filling how many flavor profiles can someone make if they have 6 cherry types and sufficiently many of each type to make any given combination to make the filling.

Would it be (16+6-1)!/(6!(16-1)!) = 54,264 different combinations? (using stars and bars)

1

There are 1 best solutions below

0
On BEST ANSWER

Consider the different flavors the "boxes." Consider each cherry itself a "ball." We distribute the balls into the boxes, i.e. we decide how many of which flavor of cherry to use for a particular pie.

The number of ways in which we can do this we see via stars-and-bars as being

$$\binom{\text{#balls + #boxes - 1}}{\text{#boxes - 1}} = \binom{16+6-1}{6-1}=\dfrac{(16+6-1)!}{16!(6-1)!}$$

Your answer incorrectly used the wrong denominator, having accidentally had $\text{#boxes}$ as the second argument in the binomial coefficient rather than $\text{#boxes - 1}$. Some authors will write the answer with $n$ as the number of boxes and $k$ as the number of balls. Other authors might write the answer with these swapped, $n$ instead being the number of balls and $k$ the number of boxes. Remember the formula in terms of where you write the number of boxes and where you write the number of balls and reinterpret the problem as boxes and balls to avoid confusion.


Now, your answer doesn't have anything to do with $n$. Assuming you are wanting to make $n$ pies with possibly varying flavor profiles, you are allowed to repeat flavor profiles, and order in which we list these pies is irrelevant, we need to apply stars and bars once more. The pies are the balls here and there are $n$ of them. The flavor profiles are the boxes now and there are $\binom{16+6-1}{6-1}$ of them. This gives a final answer of:

$$\binom{n+\binom{16+6-1}{6-1}-1}{\binom{16+6-1}{6-1}-1}=\binom{n+\binom{16+6-1}{6-1}-1}{n}$$