How many distinct permutations of the string "NADAMADRID" have the word DAM appearing in them?

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.


If we discard the word $DAM$ temporarily, we have $7$ letters to arrange, out of which two letters of two types are similar. The arrangement of these can be done in $\frac{7!}{(2!)^2}$ ways. Once this is done, we have $8$ spaces for the word $DAM$ to be inserted into , so in total you get $$\frac{7!}{(2!)^2} \times 8 = 10080$$ ways.


Just treat $DAM$ like another unique letter. Then you have 8 letters total, with two $A$'s and two $D$'s (after you take out those used in $DAM$). So the total number of arrangements is $$\frac{8!}{2!2!}$$

Note this would get more complicated if there were more than one $M$, as then you'd have to account for instances with two $DAM$'s by inclusion-exclusion.