Counting the number of words containing a specific subword, and not another subword Consider the $10$ letter word
$$PRRAAAATTM$$
and all the words formed by rearranging its letters. How many of these words contain the subword $RAT$ but do not contain the subword $MAP$?  
This is what I tried:  
Let $R$ be the set of words containing the subword $RAT$.
Let $M$ be the set of words containing the subword $MAP$.  
Then I want to compute $|R-M| = |R| - |R\cap M$|.  
To count $|R|$, we count the number of words containing at least one $RAT$, and subtract the number of words containing  $RAT$ at least twice + number of words containing $RAT$ at least three times - number of words containining $RAT$ at least four times - ... and so on.  
Since only two $RAT$'s are possible, then
$|R|$ = number of words containing at least one $RAT$ -  number of words containing two $RAT$'s.  
Number of words containing at least one $RAT$ is
$$\binom{8}1 \times \frac{7!}{3}$$
and number of words containing two $RAT$'s is
$$\binom{6}2 \times \frac{4!}{2!}.$$
So
$$|R| = \binom{8}1\times\frac{7!}{3!} - \binom{6}2\times\frac{4!}{2!}
$$
Now   with similar reasoning,
$$|M\cap R| = \binom{6}2\times\frac{4!}{2!} - \binom{4}3
$$
So
$$|R-M| = \binom{8}1\times\frac{7!}{3!} - 4!\times\binom{6}2 + \binom{4}3$$
 A: Though $|R|=6540$ is correct, the following part is incorrect :

Number of words containing at least one $RAT$ is
  $$\binom{8}1 \times \frac{7!}{3}$$

Also, the following part is incorrect :

Now   with similar reasoning,
  $$|M\cap R| = \binom{6}2\times\frac{4!}{2!} - \binom{4}3$$


Let us define $N_1,N_2,N_3,N_4$ as follows :
$N_1$ : the number of words containing exactly one $RAT$
$N_2$ : the number of words containing exactly two $RAT$s
$N_3$ : the number of words containing exactly one $RAT$ and one $MAP$
$N_4$ : the number of words containing exactly two $RAT$s and one $MAP$
Then, we have
$$|R|=N_1+N_2\quad\text{and}\quad |M\cap R|=N_3+N_4$$

Replacing $RAT,RAT$ with $K,K$, we have $KKPAAM$, so $$N_2=\frac{6!}{2!2!}=180$$
Replacing only one $RAT$ with $K$, we have $KRAAATPM$, so $$\frac{8!}{3!}=N_1+2N_2\implies N_1=6360$$
It follows from this that $$|R|=N_1+N_2=6540$$

Replacing $RAT,RAT,MAP$ with $K,K,L$ respectively, we have $KKLA$, so
$$N_4=\frac{4!}{2!}=12$$
Replacing one $RAT$ with $K$ and $MAP$ with $L$, we have $RAATKL$, so
$$\frac{6!}{2!}=N_3+2N_4\implies N_3=336$$
It follows from this that $$|M\cap R|=N_3+N_4=348$$

Therefore, the answer is
$$|R|-|M\cap R|=6540-348=\color{red}{6192}$$
A: @mathlove has provided you with a nice answer.  Here is an alternative approach:
Number of words containing RAT:  We have eight objects to arrange: RAT, A, A, A, M, P, R, T.  We can choose three positions for the As, then arrange the remaining five distinct objects in the remaining five places in 
$$\binom{8}{3}5!$$
ways.
Number of words containing two RATs:  We have six objects to arrange: RAT, RAT, A, A, M, P, R.  We choose two of the six positions for the RATs, two of the remaining four positions for the As, then arrange the remaining two distinct objects in the remaining two places in 
$$\binom{6}{2}\binom{4}{2}2!$$
ways.  
Hence, 
$$|R| = \binom{8}{3}5! - \binom{6}{2}\binom{4}{2}2!$$
Number of words containing RAT and MAP:  We have six objects to arrange:  MAP, RAT, A, A, R, T.  We can choose two of the six positions for the As, then arrange the remaining four distinct objects in the remaining four positions in 
$$\binom{6}{2}4!$$
ways.
Number of words containing two RATs and MAP:  We have four objects to arrange: MAP, RAT, RAT, A.  We can choose two of the four positions for the RATs, then arrange the remaining two distinct objects in the remaining two positions in 
$$\binom{4}{2}2!$$
ways.  
Hence, 
$$|M \cap R| = \binom{6}{2}4! - \binom{4}{2}2!$$
Therefore,
$$|R - M| = |R| - |M \cap R| = \binom{8}{3}5! - \binom{6}{2}\binom{4}{2}2! - \left[\binom{6}{2}4! - \binom{4}{2}2!\right]$$ 
