My Question
I want to know two things: is my solution correct, and is there another, more clever, way to solve it?
My Solution
There are a total of $\frac{9!}{3!3!3!}$ arrangements of $xxxyyyzzz$. We must subtract the amount of these arrangements with consecutive triples from the total to get our answer.
$A =$ an arrangment where xxx appears
$B =$ an arrangement where yyy appears
$C =$ an arrangement where zzz appears
We must find $|A\cup B\cup C|$ and subtract it from the total number of arrangements
By the inclusion-exclusion principle, $|A\cup B\cup C| = (|A|+|B|+|C|) - (|A\cap B| + |A\cap C| + |B\cap C|) + (|A\cap B\cap C|)$
$|A| = |B| = |C| = \frac{7!}{3!3!1!}$
$|A\cap B| = |A \cap C| = |B\cap C|= \frac{5!}{3!1!1!}$
$|A\cap B\cap C| = 3!$
Therefore, our answer $= \frac{9!}{3!3!3!} -3*\frac{7!}{3!3!1!} + 3*\frac{5!}{3!1!1!} - 3!$
Here is another way to work this (which is slightly more complicated):
Let $A_i$ be the set of arrangements which have the same letter in places $i, i+1, i+2$ for $1\le i\le7$.
Then $\displaystyle|A_i^{c}\cap\cdots\cap A_7^{c}|=\frac{9!}{3!3!3!}-\sum|A_i|+\sum|A_i\cap A_j|-\sum|A_i\cap A_j\cap A_k|$
$\displaystyle\hspace{1.35 in}=\frac{9!}{3!3!3!}-7\cdot 3\cdot\frac{6!}{3!3!}+10\cdot3\cdot2-3!=1314.$