16. Find the number of ways to arrange the letters $\mathrm{A}, \mathrm{A}, \mathrm{B}, \mathrm{B}, \mathrm{C}, \mathrm{C}, \mathrm{D}$ and $\mathrm{E}$ in a line, such that there are no consecutive identical letters.
16. Answer: 2220
We shall use the Principle of Inclusion and Exclusion. There are $\frac{8!}{21212!}$ ways to arrange the letters without restriction. There are $\frac{7!}{212!}$ ways to arrange the letters such that both the As occur consecutively. (Note that this is the same number if we use $\mathrm{B}$ or C instead of A.)
There are $\frac{61}{2!}$ ways to arrange the letters such that both $\mathrm{As}$ and $\mathrm{Bs}$ are consecutive. (Again this number is the same for other possible pairs.) Finally there are 5 ! ways to arrange the letters such that $\mathrm{As}, \mathrm{Bs}$ and $\mathrm{Cs}$ occur consecutively.
For there to be no consecutive identical letters, total number of ways is
$$
\frac{8!}{2!2!2!}-3 \times \frac{7!}{2!2!}+3 \times \frac{6!}{2!}-5!=2220
$$