Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How many strings of six lowercase letters contain the letters a and b in consecutive positions with a preceding b, with all letters distinct?

Can someone give me a general method for thinking about this problem?

Thank you.

share|cite|improve this question
up vote 5 down vote accepted

Think about the following different cases:






How many possibilities are there for case 1?

Can you see why there are the same number of possibilities for each of the five cases?

If so, take the number of possibilities for case 1 and multiply by 5.

share|cite|improve this answer
In the first case, are there 26*25*24*23 possibilities for the remaining positions? – user1038665 Nov 7 '12 at 4:06
I assume the '26' is because you are thinking of the 26 different letters in the alphabet. But one of the requirements is that all letters are distinct... – Benjamin Dickman Nov 7 '12 at 4:11
Ah, ok, so the four positions have possibilities 24*23*22*21? – user1038665 Nov 7 '12 at 4:40
Yes indeed! Now just remember there are 5 different cases and you can finish the problem off. – Benjamin Dickman Nov 7 '12 at 6:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.