TITLE: How many different arrangements are there problem
QUESTION [8 upvotes]: How many different arrangements are there of all the nine letters A, A, A, B, B, B, C, C, C in a row if no two of the same letters are adjacent?
First I tried to find how many ways to arrange so at least two similar letters are adjacent (the complementary) then subtract from total ways without restriction. I tried to do this via extended addition rule (i.e. with the three circle venn diagram) and now I'm confused how to calculate each case. 
My attempt so far: 
let a be set of 'two A's adjacent to each other'
let b be set of 'two B's adjacent to each other'
let c be set of 'two C's adjacent to each other'
I need to find |complement of a U b U c| (Let Z be universal set, no restriction)
= |Z| - |a| - |b| - |c| + |ab| + |bc| + |ca| - |abc|
I know |a| = |b| = |c| and |ab| = |bc| = |ca| 
therefore |complement of a U b U c| = |Z| - 3|a| + 3|ab| -|abc|.
|Z| = 9!/3!3!3!, but I'm not sure how to compute |a| or |ab| or |abc|

REPLY [3 votes]: Let $A_i$ be the set of arrangements with at least 2 consecutive letters of type $i$, where $1\le i\le3$.
Then $\displaystyle|\overline{A_1}\cap\overline{A_2}\cap\overline{A_3}|=|S|-\sum_{i}|A_i|+\sum_{i<j}|A_i\cap A_j|-|A_1\cap A_2\cap A_3|,\;\;$
where $\displaystyle|S|=\frac{9!}{3!3!3!}=\color{blue}{1680}$.
1) To find $|A_i|$, we will count the number of arrangements of AA, A, B, B, B, C, C, C and then 
$\;\;\;$adjust for overcounting, which gives $\displaystyle \frac{8!}{3!3!}-\frac{7!}{3!3!}=\color{blue}{980}$.
2) To find $|A_i\cap A_j|$, we will count the number of arrangements of AA, A, BB, B, C, C, C and then
$\;\;\;$adjust for overcounting, which gives $\displaystyle\frac{7!}{3!}-2\cdot\frac{6!}{3!}+\frac{5!}{3!}=\color{blue}{620}$.
3) To find $|A_1\cap A_2\cap A_3|$, we will count the number of arrangements of AA, A, BB, B, CC, C and then
$\;\;\;$adjust for overcounting, which gives $\displaystyle6!-3\cdot5!+3\cdot4!-3!=\color{blue}{426}$.
Therefore $\displaystyle|\overline{A_1}\cap\overline{A_2}\cap\overline{A_3}|=1680-3\cdot980+3\cdot620-426=\color{red}{174}$.