1

I am trying to find out the number of distinct $n$-lettered words with lowercase letters which have at least 2 $a$s, 1 $b$, and 1 $c$. I could not figure a way to do it. I am unable to eliminate duplicates.

I have gone through Smirnov or Carlitz words. But it didn't help me.

N. F. Taussig
  • 76,571
kumarp
  • 13
  • 1
    Look up multinomials: https://en.wikipedia.org/wiki/Multinomial_theorem (See the example at the end with MISSISSIPPI) – bonsoon Nov 23 '21 at 04:23
  • $\binom{n}{2}\binom{n-2}{1}\binom{n-3}{1} 23^{n-4}$ probably, assuming you're using a $26$-letter alphabet. Choose the positions of the two $a$'s, then the $b$, then the $c$, then count up remaining ways to set letters for the other positions with the remaining letters. – user525966 Nov 23 '21 at 04:41
  • @kumarp You should not edit a question after it has been answered since that invalidates the answers you have already received. Instead, you should ask a separate question. Please revise your question so that it matches the original statement and the answers provided by user525966 (in the comments) and Angelica, then inform Bulbasaur about the change. After doing so, you should post the new question you intended to ask. Your new question should include your attempts to solve it and an explanation of where you got stuck. – N. F. Taussig Nov 23 '21 at 17:32

1 Answers1

2

One way to think about solving this problem is taking $n$ blanks, and counting the ways to assign letters to those blanks. As an example, I will be showing how this would be done for $n=6$, but the formulas should apply for all $n$.

So we start with $n$ blanks, and we want to put an "a" in somewhere. Clearly there are $n=6$ ways to do that:

a _ _ _ _ _ / _ a _ _ _ _ / _ _ a _ _ _ / _ _ _ a _ _ / _ _ _ _ a _ / _ _ _ _ _ a

Now note in each case, there are $n-1=5$ blanks left. For the second "a", we thus have $n-1=5$ possibilities: (Suppose we chose the third option before)

a _ a _ _ _ / _ a a _ _ _ / _ _ a a _ _ / _ _ a _ a _ / _ _ a _ _ a

This gives us a total of $n(n-1)=6\cdot 5=30$ options for placing the a's. But you'll notice that for the final word, it doesn't matter whether we place (for example) an a in the first position then third, or third position and then the first. So it turns out we've double-counted each positibility. Accounting for this, we get $n(n-1)/2=6\cdot 5/2=15$.

Now to place the "b", we have $n-2=4$ options:

a b a _ _ _ / a _ a b _ _ / a _ a _ b _ / a _ a _ _ b

And to place the "c", we have $n-3=3$ options:

a c a _ _ b / a _ a c _ b / a _ a _ c b

Now we are up to $n(n-1)(n-2)(n-3)/2=6\cdot5\cdot4\cdot3/2=180$ possibilities for filling the blanks. All that remains is to fill in the unspecified letters. Since these cannot be a, b, or c without disrupting the required counts, we have $23$ options for each of these, and each remaining blank can be filled independently. So we have another $23^{n-4}=23^2$ options.

Our final count is therefore $n(n-1)(n-2)(n-3)23^{n-4}/2=180\cdot23^2$ possibilities.


If you are familiar with factorials, you may have noticed a bit of a pattern developing as we were assigning letters to blanks. In fact, that whole bit can be written in terms of factorials for any sort of letter specifications using the following theorem:

The number of ways to arrange $n$ elements, which come from $k$ groups of $n_i$ indistinguishable elements ($n_1+n_2+\cdots+n_k=n$) is given by:

$$N=\frac{n!}{n_1!n_2!\cdots n_k!}$$

In this specific case, we have $2$ a's ($n_1=2$), $1$ b ($n_2=1$), $1$ c ($n_3=1$), and $n-4$ other letters ($n_4=n-4$). Once we also account for how we can choose the unspecified letters, we get a final answer of:

$$N=\frac{n!}{2\cdot1\cdot1\cdot(n-4)!}23^{n-4}$$

You can confirm that this is equivalent to our previous answer.

Angelica
  • 1,963
  • 1
    The followed the same procedure but the answer seems incorrect. For n=5, the answer given in 1460 but you will get 1380 from the above procedure – kumarp Nov 23 '21 at 04:59
  • 1
    $1380$ is the right answer to your question for $n=5$ (matches my result too) unless there is additional information you forgot to mention by chance – user525966 Nov 23 '21 at 05:05
  • Yeah I forgot to mention. Now I modified the question – kumarp Nov 23 '21 at 07:06