How many strings of six lowercase letters from the English alphabet contain the letter a

combinatoricsdiscrete mathematicspermutations

How many strings of six lowercase letters from the English alphabet
contain the letter a?

The answer to this problem is:

$26^6-25^6$ by the principle of inclusion-exclusion

My question is: why we can't calculate it in this way: $6*26^5$ as we calculate the number possible positions for a letter multiplied by the number of ways to select the other 5 letters of the six-letters?

Best Answer

The reason is because $26^5$ is the list of all strings of length five, and while there are six different ways to insert an "a" into each of those strings, some of those strings already have an "a" or more than one "a" in them. We don't want to use $25^5 * 6$ either as this doesn't include strings that have more than one "a". The easiest way is to count all the strings of length six ($26^6$) and remove those that don't have an "a" in them ($25^6$)