Number of arrangements with no consecutive letter the same

6.2k Views Asked by At

I was learning the following questions in this site
question 1
question 2
which are indeed similar problems. But, one thing I observed is, in both of these problems, letters are repeating only two times. But, consider the following situation where one letter repeats two times and another three times.

How many arrangements of the letters in the word ABCDDEEE have no consecutive letter the same?

With similar logic, by applying inclusion-exclusion principle,

Answer must be $$\dfrac{8!}{2! \times 3!}-\left(\dfrac{7!}{3!}+\dfrac{6!}{2!}\right)+5! =2280$$

But, I have checked with a program and answer appears to be $960$.

Could you please help me to understand why I am going wrong here? If anyone any general approach is there, please suggest.

3

There are 3 best solutions below

16
On BEST ANSWER

We shall solve by successively applying the well known "gap" and "subtraction" methods.

Firstly, we shall keep the $E's$ separate by placing them in the gaps of $-A-B-C-D-D-$ and permute the other letters, thus $\binom63\cdot\frac{5!}{2!} = 1200$ ways.

We shall now subtract arrangements with the $D's$ together treating them as a super $D$, $-A-B-C-\mathscr D-$, i.e. $\binom53\cdot4!= 240$

Thus we get $1200-240 = \boxed{960}$

5
On

Your potential answer only subtracts triple E. It doesn't address double E.

OK, I got the 960 by taking a quite different approach.

The three Es must be separated with at least one letter between the first and second and between the second and third. So we have four spots around the 3 Es and the middle two of those spots must each have at least one letter. So we have three other letter to distribute among the 4 spots: which gives us 6!/(3!*3!) ways the letters can be distributed without consider the letters are different. Multiply that by 5!/2! (five other letters but the Ds are dupes) to get the total possible arrangements. That is 1200.

Repeat the same process considering the two Ds as a single entity: 5!/(3!*2!) * 4!. This yields 240 arrangements with the Es separated but the Ds together.

The difference is our answer: 960

1
On

Write $X$ for each of $A$, $B$, $C$ and leave a lot of space around these: $\ \underline{\quad}X\underline{\quad}X\underline{\quad}X\underline{\quad}\ $. Then consider the following cases:

(a) All three $E$s in the same slot. This requires the two $D$s to separate the $E$s. Makes $4$.

(b) Two $E$s in one slot and one $E$ in another slot. This requires one $D$ to separate the $E$s. The remaining $D$ can be put in any of the now $6$ slots. Makes $4\cdot3\cdot 6=72$.

(c) One $E$ each in three of the four large slots. Then select two of the now $7$ slots for a $D$. Makes $4\cdot{7\choose2}=84$.

We now have $4+72+84=160$ cases in all. Replacing the $X$s by $A$, $B$, $C$ in any order brings us to $6\cdot160=960$ admissible strings.