<s>[INST] Letters order - combinatorics Question: How many words is it able to create from the letters $LYCANTHROPIES$ so $C$ won't stand next to $A$ won't stand next to $N$ and $N$ won't stand next to T.
I thought about $13! - 3\cdot 2 \cdot 12! - 2 \cdot 10!$, when $13!$ is the maximum number of words I can create with no limitations, $2 \cdot 12!$ is the number of words when two letters stand next to each other (there are 3 options for this situation) and finally the situation when all the "forbidden" letters stand next to each other ($2 \cdot 10!$).
But the answer is $13! - 3 \cdot 2 \cdot 12! + 2 \cdot 2 \cdot 11! + 2 \cdot 2 \cdot 11! - 2 \cdot 10!$
Any idea what am I missing?
 [/INST] At first we see that $LYCANTHROPIES$ consists of $13$ pairwise different characters.

The number of all words of length $13$ which can be built from these characters is
  \begin{align*}
13!
\end{align*}

Forbidden subwords are the following six words
\begin{align*}
&AC,CA,\\
&AN,NA\\
&NT,TN
\end{align*}

Therefore we have to subtract all words which contain (at least) one of these six forbidden words from $13!$
  \begin{align*}
-3\cdot 2\cdot 12!\tag{1}
\end{align*}

Since some words contain more than one forbidden word, these are counted more than once in (1) and we have to  compensate for it.
We consider two different cases. Words which contain two forbidden subwords consisting of four different characters and words which contain two forbidden subwords consisting of three different characters which do overlap. They are
\begin{align*}
&AC,NT&ANT\\
&AC,TN&CAN\\
&CA,NT&NAC\\
&CA,TN&TNA
\end{align*}

So, we have to add the number of these words giving
  \begin{align*}
+2\cdot 2\cdot 11!+2\cdot 2\cdot 11!\tag{2}
\end{align*}

In (2) we count the words which contain three forbidden words too often and we have to compensate for them. Since each character occurs exactly once, the following two forbidden triplets are to consider
\begin{align*}
CANT, TNAC
\end{align*}

So, we  have to subtract
  \begin{align*}
-2*10!
\end{align*}
and we finally obtain
  \begin{align*}
13!-3\cdot 2\cdot 12!+2\cdot 2\cdot 11!+2\cdot 2\cdot 11!-2\cdot 10!
\end{align*}

Note: This answer follows the inclusion-exclusion principle.
</s>