Principle of inclusion and exclusion problem

247 Views Asked by At

I've got 5 bottles of rum, 4 bottles of vodka and 3 bottles of whisky. How many ways are to arrange them into a line when all the bottles of the same kind can't stand next to each other(the bottles of one kind are indistinguishable). My answer was $\frac{(5+4+3)!}{5!4!3!}-\frac{(5+4+1)!}{5!4!}-\frac{(5+1+3)!}{5!3!}-\frac{(1+4+3)!}{4!3!}$, because i subtract the ways of arrangement when all the bottles of one kind stand next to each other. I was told that it's false, and I'm to use PIE. It's really hard for me to just accept that without an explanation and use a formula I don't really understand. Could someone walk me through this problem and explain what I did wrong and how should I use the principle?

1

There are 1 best solutions below

0
On BEST ANSWER

Consider the arrangement RVVVVRRWWWRR: all of the bottles of vodka are together, so you counted this in your $\frac{(5+1+3)!}{5!3!}$ term, and all of the bottles of whisky are together, so you also counted it in your $\frac{(5+4+1)!}{5!4!}$ term. Thus, you’ve subtracted this arrangement twice from the original $\frac{(5+4+3)!}{5!4!3!}$, so you’ve counted it a total of $-1$ times. You want to count it $0$ times, so you need to add it back in. The same is true of all arrangements that have all of the vodka together and all of the whisky together, and there are $\frac{(5+1+1)!}{5!}$ such arrangements, so you need to add $\frac{(5+1+1)!}{5!}$ to your answer.

There is a similar problem with arrangements that have all of the vodka together and all of the rum together, and with the arrangements that have all of the rum together and all of the whisky together, and you have to make similar corrections for them, giving you

$$\begin{align*}\frac{(5+4+3)!}{5!4!3!}&-\frac{(5+4+1)!}{5!4!}-\frac{(5+1+3)!}{5!3!}-\frac{(1+4+3)!}{4!3!}\\\\ &+\frac{(5+1+1)!}{5!}+\frac{(1+4+1)!}{4!}+\frac{(1+1+3)!}{3!}\;. \end{align*}$$

You’re still not quite finished, however: each arrangement that has all of the vodka bottles together, all of the rum bottles together, and all of the whisky bottles together has been counted once in the first term, $-3$ times in the next three terms, and $3$ times in the last three terms, for a net total of one time. We don’t want to include these arrangements, so we need to subtract them:

$$\begin{align*}\frac{(5+4+3)!}{5!4!3!}&-\frac{(5+4+1)!}{5!4!}-\frac{(5+1+3)!}{5!3!}-\frac{(1+4+3)!}{4!3!}\\\\ &+\frac{(5+1+1)!}{5!}+\frac{(1+4+1)!}{4!}+\frac{(1+1+3)!}{3!}\\\\ &-3!\;. \end{align*}$$

Your answer was the beginning of the inclusion-exclusion calculation, but only the beginning.