combinatorics - request for checking solution

90 Views Asked by At

A shop offers infinite number of 7 distinct flavours of ice cream. In how many ways can the customer create his/her portion given that order can consist of at most 5 scoops of ice cream and that the case of cup without ice creams is neglected?

Made corrections to my initial solution.

Solution:

let $A_{i}$ -multiset of size $i$ of all possible ice cream portions customer can order ($i\in \{1,2,3,4,5\}$). Consider computation of $|A_{i}|$, except $|A_{1}|$, which is trivially equal to 7, by the use of "stars & bars "method. There are 8 bars for, $i$ stars, giving directly combinations with repetitions size $i$ from the set consisting of $7+i-1 = 6 + i$ elements. Hence: $|A_{i}| ={{6+i}\choose{i}} = \frac{(6+i)!}{i! 6!} $. Also: $ (i\neq j) \implies A_{i} \cap A_{j}=\emptyset$. The rule of sum implies: number |S| of all possible orders is: $|S|=|\bigcup\limits_{i=1}^{5}A_{i}|=\sum\limits_{i=1}^{5} |A_{i}| =\sum\limits_{i=1}^{5}\frac{(6+i)!}{i!6!}=\frac{7!}{1!6!} + \frac{8!}{2!6!} + \frac{9!}{3!6!} + \frac{10!}{4!6!} + \frac{11!}{5!6!} = 7 + 28+\frac{9 \times 8 \times 7}{3\times2} + \frac{10\times9\times8\times7}{4\times3\times2} + \frac{11\times10\times9\times8\times7}{5\times4\times3\times2}=7+28+84+210+462 = 791 $

Can anyone state whether my current solution is correct? Thanks for help in advance!

2

There are 2 best solutions below

1
On

No, you can't just divide by $i!$, because not all combinations are counted that many times -- for example for a 4-scoop order, $7^4$ counts "vanilla, vanilla, vanilla, vanilla" only once.

(A different hint that something is awry is that the only prime that divides $7^i$ is $7$, so when $i\ge 2$, $7^i/i!$ is not even an integer!)

A better strategy: Add an 8th flavor, "nothing", and use stars-and-bars to figure out the number of ways to write 5 as the sum of 8 non-negative integers. Then subtract one for the "5 × nothing" order.

6
On

You've correctly figured out that $i \neq j \implies A_i \cap A_j = \emptyset$; that's a good start!

The last part is counting what each $A_i$ contains. [Since Henning Makholm has already pointed out the errors I shall only provide an alternative method of counting.]

Converting the problem into our trusty stars and bars sequence, you get $i$ ice creams(stars) separated into $7$ categories by $6$ bars. If you have $x$ stars appearing before the first bar, then that represents $x$ ice creams of the first type; if $x$ stars appear between the first and second bar, it represents $x$ ice creams of the second type, and so on. So, count the number of sequences of $i$ stars and $6$ bars.

This is the usual way of counting $i$-sized multisets whose elements all belong to a given set, which in this case is $[7]$.