2

How many $6$ letter words can be formed of $A,B$ and $C$ such that each letter appears at least once in the word?

My solution goes like this:

The total number of words possible is $3^6$. Now, we do complementary counting. The number of ways to choose 1 letter out of those $3$, such that the word formed has only one letter is $\binom {3}{1}$. Now, if the word is formed only of $2$ letters then, the number of such words is $\binom {3}{2}2^6$. Hence, the required number of words is $3^6-(\binom {3}{1}+\binom {3}{2}2^6)$.

Is the above solution correct? Is it valid? If not, where is it going wrong? I am not quite getting it.There may be many posts concerning the same topic but I can't seem to find it either....

N. F. Taussig
  • 76,571
Arthur
  • 2,614
  • Your (edited) posting is now much closer to my (edited) answer. However, you can't really attack this problem without understanding Inclusion-Exclusion theory. See my answer. – user2661923 Nov 17 '22 at 04:43

1 Answers1

3

Addendum added to respond to the comment question of Franklin.


I think that Inclusion - Exclusion should be used here. See this article for an introduction to Inclusion-Exclusion. Then, see this answer for an explanation of and justification for the Inclusion-Exclusion formula.

Using the syntax of the second link, let $S$ denote the set of all of the possible words that can be formed.

Then, Let $S_A$ denote the set of all of the possible words that can be formed that do not contain the letter A.

Define $S_B$ and $S_C$ similarly.

Then, the desired computation is

$$|S| - |S_A \cup S_B \cup S_C|. \tag1 $$

$|S| = 3^6,$ because there are $3$ choices for each of the $6$ letter-positions.

By Inclusion-Exclusion Theory, you have that

$$|S_A \cup S_B \cup S_C|$$

$$= |S_A| + |S_B| + |S_C|$$

$$- \left( ~|S_A \cap S_B| + |S_A \cap S_C| + |S_B \cap S_C| ~\right)$$

$$= (3 \times 2^6) - (3 \times 1^6).$$

Therefore, the overall enumeration is

$$3^6 - \left[3 \times 2^6\right] + \left[3 \times 1^6\right].$$


Addendum

Responding to the comment question of Franklin.

where is my solution going wrong?

You are mismanaging the situation where only one letter is used. The easiest way to see this is to regard the computation of $~\displaystyle \binom{3}{1}~$ as actually representing the union of three sets.

  • The set consisting of the single word AAAAAA

  • The set consisting of the single word BBBBBB

  • The set consisting of the single word CCCCCC

For simplicity, I will examine the specific set containing the single word AAAAAA. The consideration of the other two words will be similar.

The idea is that this specific unsatisfactory word, AAAAAA should be deducted once overall.

It is actually deducted twice:

  • Once in the computation of $|S_B|$.
  • Once in the computation of $|S_C|$.

Then, it is added back once, in the computation of $|S_B \cap S_C|$. So, the net effect is that it is deducted twice and then added back once.

This type of analysis is the backbone of Inclusion Exclusion. In order to have a deeper, more confident understanding of Inclusion-Exclusion theory, you need to study the two Inclusion Exclusion links that I provided at the start of my answer, more closely.

user2661923
  • 35,619
  • 3
  • 17
  • 39
  • Thank you!But where is my solution going wrong?... – Arthur Nov 17 '22 at 06:17
  • Thank you! But I think something maybe wrong with ur computation of $|S_A\cup S_B\cup S_C|$. Shouldn't we also add the $|S_A\cap S_B\cap S_C|$ in that computation ?... – Arthur Nov 17 '22 at 08:08
  • @Franklin I am in the process of adding an Addendum to my answer that will respond to your first comment/question. As for your 2nd comment, that is a very good point. However, in this specific problem, that can be omitted because $$|S_A \cap S_B \cap S_C|$$ is the empty set. That is, if you don't use any of the letters A,B, or C, then you can not construct a 6 character word. This is under the assumption that the only allowable letters are A,B,C. More formally, you have that $$|S_A \cap S_B \cap S_C| = \binom{3}{3} \times 0^6.$$ – user2661923 Nov 17 '22 at 08:12
  • @Franklin As for your first comment question, see the Addendum that I have just added to the end of my answer. – user2661923 Nov 17 '22 at 08:20
  • Thank you! I do get it now...Thanks a lot!... – Arthur Nov 17 '22 at 08:45