How many distinct permutations of the string "NADAMADRID" have the word DAM appearing in them? How many distinct permutations of the string &quot;NADAMADRID&quot;  have the word DAM appearing in them?
Normally, under the Mississippi Rule, you would take the total number of characters factorial, then divide by the product of all the characters that repeat factorial. In this case however, they ask how many times a certain word will appear in the permuations of a bigger string. I was confused on how to do this problem, and how i would count these possibilites.
I assume you don't distinguish between the same letters, e.g. $D_1$ and $D_2$ are the same, i.e. they are the same color. In such case, you have $10-3+1=8$ position for DAM. For each such position you have $\binom{7}{2}\binom{5}{2}\binom{3}{1}\binom{2}{1}$ allocations for remaining letters.
If you distinguish between letters as above, you also need to account for selection of 'D' and 'A' for DAM, e.g. D can be selected in $\binom{3}{1}$ ways, etc.
The string &quot;NADAMADRID&quot;  contain exactly total 10 characters.
Now consider DAM  as a single character (Say DAM = X), so the new string of
total 8 characters will be XNAADDRI.
Here we see,

X occurs once
N occurs once
A occurs twice(2)
D occurs twice(2)
R occurs once
6.I occurs once

Hence the permutations of XNAADDRI (i.e &quot;NADAMADRID&quot; have the word DAM ) with repeataion of A and D is 8!/(2! * 2!).