Permutations with $3$ different types of objects 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?
 A: Start by placing the apples.  All five of the gaps between them must be filled.  If the sixth non-apple goes to the left of the apples, there are $\binom 63$ possible combinations.  If the sixth non-apple goes to the right of the apples, there are another $\binom 63$ combinations.
Otherwise, one of the gaps will have two non-apples, which must consist of an orange and a pear.  There are $5$ choices of gap that can contain two non-apples, and $\binom 42$ ways to place the remaining non-apples.  The gap with two non-apples can contain the orange and pear in either order.
Thus, the total number of possibilities is $20+20+10 \cdot 6=100$.
A: 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.
