November 16, 2016

Problem No. 17. Cookies

There are 7 different types of cookies in Christine's Bakery that Mary loves. Mary wants to buy 30 cookies. If we suppose that there are enough cookies of each type she loves (at least 30 cookies of each type), in how many different ways can she buy her cookies?

Student tip

Recall how to count all possible ways to select items from a collection, such that the order of selection does not matter.












Solution

The answer lays in the 30-combinations with repetition (CR) from a set with 7 elements i.e. $$CR(7, 30) = \binom{7+30-1}{30} = \binom{36}{30} =$$ $$=\frac{36!}{30! \; 6!} = \frac{31 \cdot 32 \cdot 33 \cdot 34 \cdot 35 \cdot 36}{6!} = 1947792$$ different ways.

Example with 3 different type of cookies, and 5 cookies to buy. There are $$CR(3, 5) = \binom{3+5-1}{5} = \binom{7}{5} = \frac{7!}{5! \; 2!} = \frac{6 \cdot 7}{2} = 21$$ different ways i.e. 21 different multisubsets of size 5 form a set with 3 elements:
[5, 0, 0],
[4, 1, 0], [4, 0, 1],
[3, 2, 0], [3, 1, 1], [3, 0, 2],
[2, 3, 0], [2, 2, 1], [2, 1, 2], [2, 0, 3],
[1, 4, 0], [1, 3, 1], [1, 2, 2], [1, 1, 3], [1, 0, 4],
[0, 5, 0], [0, 4, 1], [0, 3, 2], [0, 2, 3], [0, 1, 4], [0, 0, 5],
where [x, y, z] means that in the multisubset there are x cookies of the first type, y cookies of the second type and z cookies of the third type.

Additional question

What if there have not been enough cookies of some type Mary loves? What if there have been 7 cookies of each of the 7 types she loves (49 cookies in total), and Mary still wants to by 30 cookies?

No comments:

Post a Comment