An ice cream vendor only offers five-scoop cones and fourteen different flavors. You can choose the same flavor more than once. How many choices are there?
Idea: choose "partitions". Let $\mathrm{n}$ be the number of balls and $\mathrm{p}$ be the number of flavors. We choose $p-1$ partitions from $p+n-1$ cells (the black squares are the partitions, the white squares are the balls, here $p=4, n=5$):

![](https://cdn.mathpix.com/cropped/2024_05_10_699beca3fc1a5ab13db9g-43.jpg?height=214&width=959&top_left_y=1454&top_left_x=472)

The number of cells strictly between the $(p-1)^{\text{th}}$ partition and the $p^{\text{th}}$ partition (the $0^{\text{th}}$ partition corresponds to the beginning and the $p^{\text{th}}$ to the end) corresponds to the number of balls of the $p^{\text{th}}$ flavor. For each ice cream, there is one and only one possible choice of partitions, and vice versa. Therefore, the number of choices of partitions corresponds to the number of different ice creams, i.e., $\binom{n+p-1}{p-1}$. For $\mathrm{n}=5$ and $\mathrm{p}=14$, we find 8568 possibilities. We notice that we get a result close to that of the previous question. Indeed, if we first choose the number of balls of the first flavor, we obtain a recurrence formula similar to that of the previous question.