Number of permutations of six letters with two restrictions How many permutations of the first six letters of the alphabet are there so that A and C are not adjacent and so that B is not between A and C?
Solution
According to the Complement Principle, the number of such permutations is the difference between 6!and the number of permutations in which A and C are adjacent or so that B is between A and C. The number of permutations in which A and C are together is
\begin{equation*}
5(2!)(4!) = 240 .
\end{equation*}
The number of permutations in which only B is between A and C is
\begin{equation*}
4(2!)(3!) = 48 .
\end{equation*}
The number of permutations in which B and one other letter are between A and C is
\begin{equation*}
3(2!)\left[\binom{3}{1}(2!)\right](2!) = 72 .
\end{equation*}
The number of permutations in which B and two other letters are between A and C is
\begin{equation*}
2(2!)\left[\binom{3}{2}(3!)\right](1!) = 72 .
\end{equation*}
The number of permutations in which all the remaining letters are between A and C is
\begin{equation*}
(2!)(4!) = 48 .
\end{equation*}
So,the number of permutations in which either A and C are together or B is between A and C is
\begin{equation*}
240 + 48 + 72 + 72 + 48 = 480 .
\end{equation*}
Equivalently, the number permutations in which A and C are not adjacent and in which B is not between A and C is
\begin{equation*}
6! - 480 = 240 .
\end{equation*}

Indeed.   We must count ways to arrange $A,C$, select $1$ to $3$ letters from $D,E,F$ and arrange them between $A,C$, then arrange that whole block and the remaining letters (including $B$).
$2! (\binom{3}{1}1!4!+\binom{3}{2}2!3!+\binom{3}{3}3!2!)\\ = 2! \cdot 3!\cdot ( 4!/2!+3!/1!+2!/0!)\\ = 240$
