Application of Inclusion-Exclusion Principle to determine number of ways to choose yogurt containers

90 Views Asked by At

A grocery shop sells $4$ different brands of yogurt. They have $12$ containers in stock, $3$ of each brand. In how many ways can one buy $6$ containers of yogurt? (Containers of the same brand are indistinguishable from each other.)

I know I am supposed to use the inclusion-exclusion principle here. Thanks to @JMoravitz, I see that this question is essentially asking me to solve the system $$ \left\{ \begin{array}{c} x_1+x_2+x_3+x_4=6 \\ 0\leq x_i \leq 3\\ \end{array} \right. $$ I don't know where to go from here.

2

There are 2 best solutions below

0
On BEST ANSWER

Let
$$S=\{\text{all the weak compositions of }6\}$$ $$A_1=\{\text{all the weak compositions of }6 \text{ that have some }x_i=6\}$$ $$A_2=\{\text{all the weak compositions of }6 \text{ that have some }x_i=5\}$$ $$A_3=\{\text{all the weak compositions of }6 \text{ that have some }x_i=4\}$$ Then we can use the inclusion-exclusion principle such that $$|S-(A_1 \cup A_2 \cup A_3)|=\binom{9}{3}-\binom{4}{1,3}-\binom{4}{1,1,2}-(\binom{4}{1,1,2}+\binom{4}{1,1,2})$$ $$=44$$

0
On

Even simpler would be to avoid four properties: $x_i \ge 4$. Because $6<2\cdot 4$, at most one property can fail at the same time, and inclusion-exclusion yields $$\binom{6+4-1}{4-1}-\binom{4}{1}\binom{2+4-1}{4-1} =\binom{9}{3}-4\binom{5}{3} =84-4\cdot 10 = 44$$