Counting 5-letter words that include at least one vowel

"There are five choices for the vowel and $26$ choices for each of the remaining four letters. The certain vowel can be in appear in any of the five spaces."

If the "certain" vowel is in the first position, then your sequence could be "aeghp", and if the "certain" vowel is in the second position, then your sequence could be "aeghp". So you're counting that same sequence twice, and similarly with lots of others.

However, you you subtract the number of sequences with no vowels from the total number of sequences, that does it: the problem described above does not happen. Thus $26^5 - 21^5$.


Hint: Make the numbers smaller and you can see for yourself what's wrong with your erroneous solution.

How many sequences are there of two letters from the alphabet $\{a,b,e\}$ that contain at least one vowel?

Correct solution: There are $3^2=9$ two-letter words, there is $1^3=1$ word with no vowels, so $9-1=8$ words with at least one vowel.

Erroneous solution: There are $2$ choices for the vowel and $3$ choices for the other letter. The vowel can appear in either of the two spaces. Therefore, the number is
$2\times3\times2=12$.

Why, you ask, does doing it with smaller numbers make it any easier to find the mistake? Well, you can actually list the $12$ sequences that you counted with the second method, and then you can see which ones were double-counted.


The problem is that it overcounts cases in which the remaining $4$ letters have vowels among them.

You could fix this by doing casework on the number of vowels. You'd have five terms corresponding to the five possibilities ($1$ vowel, $2$ vowels, etc.), where the number $21$ would show up a bunch because the non-vowels would have $21$ possibilities. But there's a much easier way.


We can count the number of sequences with no vowels, and subtract this from the total number of sequences. There are $21$ non-vowels and $26$ letters, so we get

$$26^5-21^5 =\boxed{7797275}$$