How many strings of six lowercase letters from the English alphabet contain the letters a and b with all letters different? Answer: 7650720
I saw a resolution that considered the two types of strings different:
1) Possible strings not containing a nor b.
2) Possible strings not containing a and b.
But I do not understand why. Can someone explain or present another solution?
Here’s one solution: there are $6$ choices for the position of a, and then $5$ choices for the position of $b$. After this we have $24$ remaining possibilities for the next letter (because all letters must be distinct, and we have used two letters already), and then $23$ possibilities, and so on... We then apply the rule of product to give
$$6 \cdot 5 \cdot 24 \cdot 23 \cdot 22 \cdot 21 = 7650720$$
To address your other question, consider the string ‘xya’. It is a string ‘not containing a and b’ because it doesn’t contain both a and b, but it is not a string ‘containing a nor b’ because it contains a.