In a sequence of length $8$ made up of characters $A, B, C, D$, how many sequences contain exactly $3$ of the $4$ characters?

266 Views Asked by At

So far I am thinking it would be $3!×3^5×\dbinom{4}{3}×6$ but I have a feeling I'm missing something.

  • $3!$ - to make sure all $3$ of the $4$ are included.
  • $3^5$ - as the other five numbers can be any of the $3$.
  • $\dbinom{4}{3}$ - number of ways you can select $3$ of $4$.
  • $6$ - number of places $3!$ could be.

Thanks in advance.

2

There are 2 best solutions below

0
On BEST ANSWER

We must choose three of the four characters to include in the sequence.

There are $3^8$ sequences of length $8$ using these three characters, but some of them use fewer than three characters. We must exclude them.

In what follows, we will assume that the three characters used in the sequence have already been selected. We will count sequences of length eight that use all three of the selected characters.

There are $\binom{3}{1}$ ways to exclude one of the selected characters and $2^8$ ways to form a sequence of length eight with the remaining two characters. Hence, there are $\binom{3}{1}2^8$ sequences of length eight that exclude one of the selected characters.

However, if we subtract the number of sequences that do not contain a particular character from the number of sequences that be formed with the three selected characters, we will have subtracted too much since we subtract those sequences from which two of the selected characters are missing twice, once for each way we could designate one of those characters as the missing one. Thus, we must add them back.

There are $\binom{3}{2}$ ways to exclude two of the three selected characters and one way to fill all eight positions in the sequence with the remaining selected character. Hence, there are $\binom{3}{2}1^8$ sequences from which of the selected characters have been excluded.

By the Inclusion-Exclusion Principle, the number of sequences of length eight that use all three of the selected characters is $$3^8 - \binom{3}{1}2^8 + \binom{3}{2}1^8$$

Since there are $\binom{4}{3}$ ways to select which three of the four characters will appear in the sequence, the number of sequences of length eight that contain exactly three of the four characters is $$\binom{4}{3}\left[3^8 - \binom{3}{1}2^8 + \binom{3}{2}1^8\right]$$

2
On

Inclusion/exclusion is the elegant way to do this problem. You weren't "missing something" so much as counting some permutations more than once. Assume the 3 letters A, B, and C and each appear at least once. Let a= # of As in the permutation, b= # of Bs in the permutation and c= # of Cs in the permutation. $a+b+c=8$ and $$8=6+1+1=5+2+1=4+3+1=3+3+2=4+2+2$$ When the three addends are distinct there are 6 ways they can be assigned to a, b, and c. When two are the same, there are only three ways the assignments may be made.

$$3\frac{8!}{6!1!1!}+6\frac{8!}{5!2!1!}+6\frac{8!}{4!3!1!}+3\frac{8!}{3!3!2!}+3\frac{8!}{4!2!2!}$$ Since there are 4 ways that the 3 letters could be chosen we must multiply this answer by 4.

23,184 permutations contain exactly 3 distinct letters.