The word MATHEMATIK (in german) has 10 letters.
I want to know how many different words can be created by using the letters of this word. However, the same letter can never be next to each other.
So for example, MAATHEMTIK is not allowed.
I did the following:
$n = 10$
$k_1 = 2$ (M)
$k_2 = 2$ (A)
$k_3 = 2$ (T)
$k_4 = 1$ (H)
$k_5 = 1$ (E)
$k_6 = 1$ (I)
$k_7 = 1$ (K)
I use the formula $\frac{n!}{k_1! \cdot k_2! ... \cdot k_n! }$ and get:
$$\frac{13!}{2! \cdot 2! \cdot 2! \cdot 1! \cdot 1! \cdot 1! \cdot 1!} = 778377600$$
This is the number of all possible words (permutations). Now we need to subtract the number of words which can be created by having the same letter next to each other, i.e.
- MAATHEMTIK
- AAMTHEMTIK
- MTAAHEMTIK
- etc.
But I don't know how to figure that out.
Please apply Principle of Inclusion Exclusion. It is a more standard approach.
Your answer would simply be
$\displaystyle \frac{10!}{2! \ 2! \ 2!} - \binom{3}{1} \ \frac{9!}{2! \ 2!} + \binom{3}{2} \ \frac{8!}{2!} - \binom{3}{3} \ 7! = 236880$
Some details -
The first term is unrestricted number of arrangements. Now we subtract from it all arrangements where either of $AA, MM, TT$ are together. If you take $AA$ together as one letter, you now have $9$ letters and the number of arrangements are $\frac{9!}{2! \ 2!}$. Now you have same number of arrangements for $MM$ and $TT$. But these overcount arrangements where two identical letters (say AA, MM) are together. As we subtracted them, we need to add them back. The same follows for the next.