# Number of ways a 6-letter word contains at least 1 “a” and at least 1 “b, c, or d”. Repeats are allowed.

I tried to approach this problem by using complementary counting. The number of ways to get a 6-letter word with no restriction is $26^6$. Then we can subtract the number of ways where the word does not contain "a, b, c, or d", which is $22^6$.

But then I realized there was a problem with this.

This problem is weird in that the word has to contain "a" and ANY of "b, c, or d." For example, the following would be valid words: "abzzzx", "axkkd", "yuabd". However, it would not be valid if the word is "bcdbcz" or "azzzzz".

I hope this makes sense. I was thinking maybe exclusion-inclusion needs to be used somewhere, but I'm not sure if this thinking is even right.

This is an extension to a counting problem I had in class (I thought of it).

## 2 Answers

Basic approach. Count up

• $x =$ the number of six-letter words with no A
• $y =$ the number of six-letter words with no B, C, or D; and
• $z =$ the number of six-letter words with no A, B, C, or D

Then use inclusion-exclusion to get

• $x+y-z =$ the number of six-letter words that either lack an A, or lack a B, C, or D, or both

Then, lastly, subtract that from the total number of six-letter words.

Casework usually works when you want complementary counting, but the problem has a few details to take care of.

Case (1): No $a,b,c,$ or $d$.
Case (2): Yes $a$, no $b,c,$ or $d$.
Case (3): No $a$, yes $b,c,$ or $d$.

These cases are mutually exclusive, and so overcounting is not possible. The sum of these cases is the complement of what you seek.

Case (1): There are $22^6$ ways.

Case (2): There are $23^6$ ways of constructing a $6$ letter word with $23$ words in the alphabet (no $b,c$ or $d$), and $22^6$ of these ways do not include $a$ (or the number of ways of constructing a $6$ letter word with $22$ words in the alphabet). Hence there are $23^6-22^6$ ways.

Case (3): There are $25^6$ ways of constructing the word without $a$. Of these ways, there are $22^6$ ways of constructing the word without any of the three letters, so there are $25^6-22^6$ ways total.

Then, there are $26^6 - (22^6) - (23^6 - 22^6) - (25^6 - 22^6) = 26^6 - 23^6 - 25^6 + 22^6$ ways total.