0
$\begingroup$

How many different strings of 5 lower case letters are there? Assume that letters may repeat and the string must contain at least one letter a? I tried this: 5×26^5=5×26 ×26 ×26 ×26=2684880

$\endgroup$
5
$\begingroup$

$(26)^5 - (25)^5.$

First term is total # of 5 character strings, where each character has 26 choices.

Second term is total # of 5 character strings, where each character has only 25 choices, re no "a" is used.

The difference between the two is the # of 5 character strings with at least 1 "a".

$\endgroup$
0
$\begingroup$

Break it into five sub-problems: exactly 1 $A$, exactly 2 $A$s, ..., exactly 5 $A$s.

One $A$: There are five places for the required $A$, and $25^4$ ways to fill the remaining four slots without the use of another $A$.

Two $A$s: There are ${5 \choose 2}$ ways to place the two $A$s, and $25^3$ ways to fill the remaining $s$ slots with letters other than $A$.

...

Five $A$s: There is ${5 \choose 5} = 1$ way to fill with all five $A$s.

Add these up.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.