the letters ABCDEFGH are to be used to form strings of length 5. How many strings contain the letter a if repetitions are allowed?
4 Answers
Hint: How many strings doesn't contain the letter A?
- $\begingroup$ You're sure that there are $8^5$ strings with all $8$ letters (and that is correct), but not that there are $7^5$ with only $7$? Why wouldn't there be, the situation is the same. - In other words: Yes, there are $7^5$ strngs without the letter A. $\endgroup$Henrik supports the community– Henrik supports the community2014-11-20 23:56:08 +00:00Commented Nov 20, 2014 at 23:56
- $\begingroup$ That's what I get too. But there's no reason to assume I'm any better at entering that into a calculator than you are. $\endgroup$Henrik supports the community– Henrik supports the community2014-11-21 00:01:08 +00:00Commented Nov 21, 2014 at 0:01
Yes the best way is to find how many string doen't contain A and subtract it from total i.e., $ 8^5 - 7^5 $
The other method is: find no. strings that has exactly 1 A : ${5 \choose 1} * 7^4$.
Then no. of string which has exactly two A : ${5 \choose 2} * 7^3$ and so on.
Thus, total no. of such strings would be = $({5 \choose 1} * 7^4 + {5 \choose 2} * 7^3 + {5 \choose 3} * 7^2 + {5 \choose 4} * 7^1 + {5 \choose 5} * 7^0)$
which equals to $15961$
You are halfway there. Now some of the strings do not contain A. How many strings are there that don't contain A? Subtract them from $8^5$ and you are done.
In general, among the very first things you should look at for counting problems is to look at the negation: in this case, how many strings don't contain a?