2

Suppose the alphabet consists of just {a,b,c,d,e}. How many 4-letter strings are there that do not have “aa” in the middle?

I so far answered: We assume that a word could have multiple same letters.

Since the word is only four letters, a can not be in the second and third position.

We look at this as a can be in either the second or third position.

Accoringly: (all combos with no a in second or third position) + all combos with a in second but not third + a in third but not second.

[C(5,1)*C(4,1)*C(4,1)*C(5,1)] + [C(5,1)*C(1,1)*C(4,1)*C(5,1)] + [C(5,1)*C(4,1)*C(1,1)*C(5,1)] =400+100+100 =600

Therefore, there are 600 4-letter strings of (a,b,c,d,e) that don't have aa in the middle.

Would that be correct, or incorrect in this case!

Thanks, A

  • How many strings are there? How many DO have "aa" in the middle? If you add the strings that do and the strings that don't what do you get? – fleablood Aug 08 '16 at 18:59
  • There are 5x5x5x5=625 letters altigether. There are 5x1x1x5=25 that have both "aa" in the middle. So there are 625-25=600 that don't. Or your way works too. – fleablood Aug 08 '16 at 19:02
  • Does aaeb count as "having aa in the middle", or is it only strings like caae? – hmakholm left over Monica Aug 08 '16 at 19:05
  • As an aside, using binomial coefficients for these is incredibly tedious. Why write C(5,1)*C(4,1)*C(4,1)*C(5,1) when you could instead write $5\cdot 4\cdot 4\cdot 5$. You don't always have to think in terms of binomial coefficients, regular numbers are useful too and more compact to say aloud and write. – JMoravitz Aug 08 '16 at 19:09
  • Linking to this duplicate. I knew the problem was familiar, but couldn't find the link at the time. The specific issue that each poster was facing were different, so I personally feel they can remain separate questions. – JMoravitz Aug 12 '16 at 09:10

2 Answers2

1

You can choose the first letter and the last letter of the string as one of the $5$ letters in the alphabet. This gives you $5^2=25$ options. For the second and third letter, out of the possible $5^2$ letter pairs, "aa" is forbidden. Thus, you have $5^2-1=24$ options for the middle letters. This leaves you with a total of $25*24=600$ strings.

r1c
  • 528
1

In this case it's easier to calculate the complement then subtract it from the total. i.e the answer is the number of words with $aa$ in the middle subtracted from the total number of words.

Clearly the number of words with $aa$ in the middle is the same as the number of $2$ letter words - $5^2$. Hence the answer you're looking for is $$5^4 - 5^2 = 600.$$

So yes your final answer is correct!

Zestylemonzi
  • 4,103