The number of anagrams that have no consecutive identical letters.

combinatorics

Consider the $9$ letters $A,S,S,S,S,R,R,E,E$. I want to count the number of $9-$letter anagrams out of these letters without two consecutive identical letters. My strategy is as follows: I start by choosing a configuration for the four letters $A,S,R,E$ and I have $4!=24$ ways to do this. Once I chose one configuration, I'm left with $5$ blanks to fill with $3$ occurrences of $S$, one $R$ and one $E$. Among the $5$ empty positions I'm not allowed to choose before and after the letter, so I have ${3 \choose 3}=1$ choice for $S$ and ${3 \choose 1}=3$ choices for $R$ and ${3 \choose 1}=3$ choices for $E$. In sum, the total number of anagrams without identical consecutive letters is $$4! \cdot 1 \cdot 3 \cdot 3=216$$
Note that the total number of anagrams without any restriction is $\dfrac{9!}{4!2!2!}=3780$.

Is my work correct?

Best Answer

Your work is incorrect. It is not clear how you accounted for the letters you had already placed when you placed the subsequent letters.

Let's begin by placing the four Ss in a row. This creates five spaces, three between successive Ss and two at the ends of the row in which the A, two Es, and two Rs can be placed. $$\square S \square S \square S \square S \square$$ In order to ensure that the Ss are separated, the three spaces between successive Ss must be occupied. The two spaces at the ends of the row may or may not be occupied.

We can break the problem down into cases, depending on how many of the five spaces are occupied.

All five spaces are occupied: Choose two of the five spaces in which to place the Es, two of the remaining three spaces in which to place the Rs, and fill the remaining space with an A. This can be done in $$\binom{5}{2}\binom{3}{2}$$ ways.

Exactly four spaces are occupied: The three spaces between successive Ss must be occupied. Therefore, the fourth occupied space must be at one of the two ends of the row. Choose which of the two spaces at the ends of the row will be occupied. Since we have five letters to place in the four spaces, one of those four spaces will receive two letters, while the other three selected spaces will each receive one. Chose which of the four spaces will receive two letters.

Suppose A is one of the two letters that share the space in which two letters are placed. There are two ways to select the letter that will be placed in the space with the A. There are $2!$ ways to arrange the A and the other letter in that space. That leaves three spaces in which to place the other copy of the letter that shares the space with the A. The remaining two spaces must be filled with the two copies of the remaining letter.

If A is not one of the two letters that share a space, then that space must be filled with an E and an R. They can be arranged in that space in $2!$ ways. The three remaining spaces must be filled with an A, an E, and an R, which can be done in $3!$ ways.

Hence, there are $$\binom{2}{1}\binom{4}{1}\left[\binom{2}{1}2!\binom{3}{1} + 2!3!\right]$$ arrangements in which exactly four of the five spaces are occupied.

Exactly three spaces are occupied: The three spaces must be the three between successive Ss. Either one of these spaces receives three letters and the other two each receive one, or two of the three spaces each receive two of the letters and the other space receives one.

One of the three spaces receives three letters and the other two reach receive one: There are three ways to choose the space that receives three letters.

There are two possibilities: Either three different letters share the space with three letters or exactly two letters share the space with three letters.

If three different letters share the space with three letters, they can be arranged within that space in $3!$ ways. That leaves an E and an R. They can be placed in the remaining two spaces in $2!$ ways.

If exactly two letters share the space with three letters, then there must either be two Es or two Rs in that space. If the two copies of that letter in the space filled with three letters are separated by an A, the remaining two spaces must be filled with the two copies of the remaining letter. If the two copies of the letter in the space filled with three letters are separated by a copy of the other letter which appears twice, then the remaining two spaces must be filled with different letters. They can be arranged in those two spaces in $2!$ ways.

Hence, there are $$\binom{3}{1}\left\{3!2! + \binom{2}{1}\left[\binom{2}{2} + 2!\right]\right\}$$ arrangements in which three letters occupy the same space and each of the other two spaces receives one letter.

Two of the three spaces each receive two letters and the other space receives one: There are three ways to select the space in which the A will be placed.

If A is placed by itself, the other two spaces each receive an E and an R. Within each of those spaces, the E and R can be arranged in $2!$ ways.

If A is not placed by itself, there are two ways to select the letter which will be placed with the A. The A and that letter can be placed in that space in $2!$ ways. There are two ways to choose the other space that will receive two letters. That space must receive an E and an R. There are $2!$ ways to arrange them within that space. The remaining letter must be placed in the third space.

Hence, there are $$\binom{3}{1}\left[2!2! + \binom{2}{1}2!\binom{2}{1}2!\right]$$ arrangements in which two of the three spaces each receive two letters and the other space receives one.

Total: Since these arrangements are mutually exclusive and exhaustive, there are $$\binom{5}{2}\binom{3}{2} + \binom{2}{1}\binom{4}{1}\left[\binom{2}{1}2!\binom{3}{1} + 2!3!\right] + \binom{3}{1}\left\{3!2! + \binom{2}{1}\left[\binom{2}{2} + 2!\right]\right\} + \binom{3}{1}\left[2!2! + \binom{2}{1}2!\binom{2}{1}2!\right]$$ arrangements of A, E, E, R, R, S, S, S, S in which no two adjacent letters are identical.