[Math] How many arrangements of the $26$ different letters are there that contain neither the sequence “the” nor the sequence “math”

combinatoricsdiscrete mathematicsinclusion-exclusion

Solve the following question via exclusion and inclusion principles. This question was a bit more tricky then other questions I have faced so I am wondering if my workings are correct, thanks!

How many arrangements of the $26$ different letters are there that contain neither the sequence "the" nor the sequence "math"?

We know that there are $24!$ arrangements that contain
the sequence "the", so there are $(26! – 24!)$ sequences that do not, as there
are 26! arrangements without restrictions.

Next, considering "math" as one element, we can arrange this and the remaining
22 letters in 23! ways. Thus there are $(26! – 23!)$ arrangements that do not contain the sequence "math".

Finally, we must consider those arrangements that contain the sequence "mathe",
as we will have deducted these arrangements twice in the first $2$ steps.
By similar reasoning to above, there are $22!$ arrangements that include "mathe", thus we will need to add $22!$ to the sum from the first $2$ steps.

This gives us a final answer of $\left[(26! – 24!) + (26! – 23!) + 22!\right] $ arrangements.

Best Answer

Not quite: you should only have one copy of $26!$ in the answer, as right now you have a result that's clearly larger than $26!$.