How many permutations of the letters ABCDEFGHI are there...

  1. That end with any letter other than C.
  2. That contain the string HI
  3. That contain the string ACD
  4. That contain the strings AB, DE and GH
  5. If letter A is somewhere to the left of letter E
  6. If letter A is somewhere to the left of letter E and there is exactly one letter between A and E

Question 1

Total number of permutations - Permutations where the letter ends in C:

9! - 8! = 322560

Question 2

Treat "HI" as singular letter and calculate permutation as usual:

8! = 40320

Question 3

Treat "ACD" as singular letter:

7! = 5040

Question 4

Treat "AB", "DE", "GH" as singular letter:

6! = 720

Question 5, 6

This is where I hit a wall. How do I know the position of A in relation to B? I feel that I won't understand the answer even if I see it.

Is my answer to Q1 - Q4 correct? What is the key to solving Q5 and Q6?

  • $\begingroup$ are you familiar with the "stars and bars" method? $\endgroup$ – RGS Nov 1 '18 at 20:26
  • $\begingroup$ @RGS I saw a tutorial once, but I need to refresh my memory. $\endgroup$ – potatoguy Nov 1 '18 at 20:29

1-4 look fine.


In exactly $\frac 12$ of all permuations will A be to the left of E, and the other half it will be to the right.

$\frac {9!}{2}$

6) We have a sequence $AxE$ there are $7$ values that $x$ can be. And then think of $AxE$ as a single letter.

$7\cdot 7!$

  • $\begingroup$ Your answer is quite clever. I think it would've been better, however, if you made the OP get there instead of just showing the solution :'( $\endgroup$ – RGS Nov 1 '18 at 20:45
  • $\begingroup$ Thanks for writing the explanation as well. It's important for me to know why the solution is correct. In hindsight, I really overcomplicated it in my head. $\endgroup$ – potatoguy Nov 1 '18 at 20:55
  • 1
    $\begingroup$ @RGS Thanks for having so much faith in me. It still took me some time to understand Doug's answer. $\endgroup$ – potatoguy Nov 1 '18 at 20:58

I find your answers to Q1 through Q4 fine!

To answer Q5, start by writing down the A and the E:

$$\_ A \_ E \_$$

where the underscores represent the three boxes in which you can fit the other letters. Can you count in how many ways those three boxes can be filled?

To answer Q6, you go for a similar reasoning. Write $A$ and $E$:

$$\_ A - E \_$$

but now you start by assigning a single letter to $-$. Then you distribute all the other letters among the two boxes $\_$.

  • $\begingroup$ I see! So given n amount of letters besides A and E, I need to find the number of permutations of how they can be placed inside these three spaces. I'm guessing it should be something like C(7+3-1, 2)? $\endgroup$ – potatoguy Nov 1 '18 at 20:34
  • $\begingroup$ Yes but then be careful, as you also need to permutate them to fix their order! Using the combinations with C you only decide which letters go to which box and you don't get to count their orderings. Give it a thought. If you can't make it I will further develop my answer. $\endgroup$ – RGS Nov 1 '18 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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