-1

Determine the number of permutations of the letters AABBCCDD in which there are no identical adjacent letters.

Attempt: Let $\Omega$ be the set of permutations of $AABBCCDD$. Let $A,B,C,D$ be the set of permutations in which the two letters $A$, $B$, $C$, $D$ are adjacent, respectively. Well I thought about solving this problem by the principle of inclusion exclusion, but I had a question.

The sum of permutations where A, B, C or D is adjacent is $630$. But why? Can't I consider, for example, $AA$ as a block and do the permutation $7!$?

2 Answers2

2

Although cumbersome, Inclusion-Exclusion eliminates much of the need for creativity. See this article for an introduction to Inclusion-Exclusion. Then, see this answer for an explanation of and justification for the Inclusion-Exclusion formula.

Using the syntax in the second link:

  • let $S$ denote the set of all possible permutations, without any regard for which letters are adjacent.

  • let $S_1$ denote the subset of $S$ that contains all of the permutations where the two A's are adjacent.

  • let $S_2, S_3$ and $S_4$ be similarly defined for the B's, C's, and D's, respectively.

Then, the desired computation is

$$|S| - |S_1 \cup S_2 \cup S_3 \cup S_4|.$$

Continuing to use the syntax of the 2nd link:

  • let $T_0$ denote $|S|.$

  • let $T_1$ denote the $~\displaystyle \binom{4}{1}$ terms given by $\displaystyle \sum_{1 \leq i_1 \leq 4} |S_{i_1}|.$

  • let $T_2$ denote the $~\displaystyle \binom{4}{2}$ terms given by $\displaystyle \sum_{1 \leq i_1 < i_2 \leq 4} |S_{i_1} \cap S_{i_2}|.$

  • let $T_3$ denote the $~\displaystyle \binom{4}{3}$ terms given by $\displaystyle \sum_{1 \leq i_1 < i_2 < i_3 \leq 4} |S_{i_1} \cap S_{i_2} \cap S_{i_3}|.$

  • let $T_4$ denote the term given by $|S_1 \cap S_2 \cap S_3 \cap S_4|.$

Then, in accordance with Inclusion-Exclusion theory, the desired computation is

$$\sum_{k=0}^4 \left[(-1)^k T_k\right]. \tag1 $$

In some of the analysis below, Stars and Bars theory will also be used.
See this article and this one.


$\underline{\text{Computation of} ~T_0}$

Since there are $(4)$ pairs of identical letters to permute,

$$\displaystyle T_0 = \frac{8!}{(2!)^4} = 2520. \tag2 $$


$\underline{\text{Computation of} ~T_1}$

First, compute $|S_1|$.
The two A's can be in any one of $(7)$ positions.
Assuming that the two A's are in the first two positions, there are $(6)$ remaining letters to permute.

Therefore, $\displaystyle ~|S_1| = 7 \times \frac{6!}{(2!)^3} = 630.$

By reasons of symmetry, $|S_1| = |S_2| = |S_3| = |S_4|.$

Therefore,

$$T_1 = 4 \times 630 = 2520. \tag2 $$


$\underline{\text{Computation of} ~T_2}$

First, compute $|S_1 \cap S_2|$.
Either the A's come first, or the B's come first.
Therefore, you start with a factor of $(2)$, and then assume that the $A's$ come first.

You can regard the A's and B's as forming two fused units, with the A's unit coming first. Then, there are potentially $(3)$ undeclared regions: before the A's, between the A's and B's, and after the B's.

These $(3)$ regions must account for the $(4)$ remaining unused letters. The number of ways that the A's and B's can be positioned is equal to the number of non-negative integer solutions to

$x_1 + x_2 + x_3 = 4 ~: ~\displaystyle \binom{6}{2} = 15~$ solutions.

Then, for each one of the $(15)$ solutions, there are $~\displaystyle \frac{4!}{(2!)^2} = 6$ ways that the C's and D's can be permuted.

Therefore,
$\displaystyle |S_1 \cap S_2| = 2 \times 15 \times 6 = 180.$

By reasons of symmetry, the other $\displaystyle \left[\binom{4}{2} - 1\right]$ terms involved in the computation of $T_2$ are identical.

Therefore,

$$T_2 = 6 \times 180 = 1080. \tag3 $$


$\underline{\text{Computation of} ~T_3}$

First, compute $|S_1 \cap S_2 \cap S_3|$.
The A's, B's, and C's can be permuted in $(3!) = 6$ ways. Therefore, you start with a factor of $(6)$, and then assume that the $A's$ come first, then the B's, and then the C's.

Similar to the analysis in the previous section, the corresponding number of arrangements is equal to the number of non-negative solutions to

$\displaystyle x_1 + x_2 + x_3 + x_4 = 2 ~: ~\binom{5}{3} = 10~$ solutions.

Here, once the A's, B's, and C's are set, the two (identical) D's can only be positioned in one way.

Therefore,
$\displaystyle |S_1 \cap S_2 \cap S_3| = 6 \times 10 = 60.$

Similar to the previous section, by reasons of symmetry, the other $\displaystyle \left[\binom{4}{3} - 1\right]$ terms involved in the computation of $T_3$ are identical.

Therefore,

$$T_3 = 4 \times 60 = 240. \tag4 $$


$\underline{\text{Computation of} ~T_4}$

The $(4)$ pairs can be permuted in $(4!)$ ways. For any given ordering of the letters, there is no wiggle room here. That is, the first pair must go in positions 1 and 2, and so forth.

Therefore,

$$T_4 = 4! = 24. \tag4 $$


$\underline{\text{Final Computation}}$

$$(T_0 + T_2 + T_4) - (T_1 + T_3) = (2520 + 1080 + 24) - (2520 + 240) = 864.$$

user2661923
  • 35,619
  • 3
  • 17
  • 39
2

Another way: Using PIE, we create EGF for each letter :$\frac{x^{2}}{2!}-\binom{1}{1}\frac{x^1}{1!} $. We get $ \left( \frac{x^{2}}{2!}-x \right)^4=\frac{1}{16}x^8-\frac{1}{2}x^7+\frac{3}{2}x^6-2x^5+x^4$ Replace each $x^k$ with $k!$ to obtain $\frac{8!}{16}-\frac{7!}{2}+\frac{3}{2}6!-2.5!+4!=\boxed {864}$

OGFandEGF
  • 124
  • 8