Permutations with $3$ different types of objects

combinatoricspermutations

So I had a question in extension for homework that gave me the question:

I have $6$ apples $3$ oranges and $3$ pears, how many ways can I line them up in a row so that no fruit is next to another one of the same type. The fruits are only differentiable by their type so no Orange1, Orange2… etc

Now first of all i thought about finding the permutations of only oranges and pears

_ _ _ _ _ _ six positions choose $3$ for the oranges and the pears go into the other three spaces so $C(^6_3)$

and insert the apples into the gaps so $C(^7_6)$

however depending on where the oranges and pairs are there sometimes must be a apple separating the two such as $O,O,O,P,P,P$ where the apples must go into the gaps between the oranges but not necessarily at the ends of in the middle.

Any ideas on how to solve this?

Best Answer

First place $6$ apples. Now there are $7$ places between apples (including left and right) and $6$ fruits that must go into those places such that no two apples are together. There are only two ways to do it -

$A \uparrow A \uparrow A \uparrow A \uparrow A \uparrow A \uparrow$

$ \uparrow A \uparrow A \uparrow A \uparrow A \uparrow A \uparrow A$

($ \uparrow$ indicates rest $6$ fruits - pears and oranges)

Now there are $ \displaystyle \frac{6!}{3! ~ 3! } $ ways to permute $3$ oranges and $3$ pears.

That gives $ \displaystyle 2 \cdot \frac{6!}{3! ~ 3! } = 40 ~ $ arrangements.

But also note that we could combine one orange and one pear together ($OP$ or $PO$) and then place all $5$ of them (a pair and $4$ individual fruits) in the $5$ places between apples.

$A \uparrow \uparrow A \uparrow A \uparrow A \uparrow A \uparrow A$

That gives $ \displaystyle 2 \cdot \frac{5!}{2! ~ 2!} = 60$ arrangements.

So in total, you get $100$ arrangements with no two fruits of the same type being adjacent to each other.

Related Question