For the problem of finding the number of strings of eight English letters that start and end with X that contain at least one vowel, if letters can be repeated, I tried to come up with a solution but it does not match the solution in the book. I am having a hard time wrapping my head around this.
What I tried: Since there are 8-2 positions (the 2 X's), for the 6 positions, there are 5 vowels and $21^5$ consonants. This would mean that there are $5*6*21^5 = 122523030$ strings.
The solution says the answer is $26^6 - 21^6 = 223,149,655 $. Wouldn't this solution just be the number of ways all letters can be positioned subtracted by number of ways all consonants can be positioned? I'm having a hard time understanding why this would be the solution.
Trying to build by hand as you have is tough; for instance, you have not accounted for any such strings that have 2 vowels in them, or 3, etc.
Instead, lets try an old trick and count the number of ways we can fail, instead of succeed. What does a failure look like? It looks like a string with no vowels at all.
So, how many strings are there with no vowels? Just place consonants (21 of these) into the 6 positions (for a total of $21^6$ strings). Well how many strings were possible to begin with? There were 6 free positions, so out of $26^6$ possible strings, only $21^6$ were bad.