How many ways can the letters of the word $XQRZX$ be arranged

combinatorics

How many ways can the letters of the word $XQRZX$ be arranged?

This is taken from the book on Combinatorics, by Daniel Marcus. The answer given is $\frac{5!}2=60$. But, am getting different answer.

I know by rote that for repeated characters the no. of arrangements are divided by no. of repetitions of each type, i.e. for a word of $n$ characters, s.t. $n \geq mk$ characters (where, $m$ characters are repeated $k$ times), then arrangements are: $\frac{n!}{m.k!}$. Similarly, for $m$ characters being repeated $k_1,\cdots, k_m$ times; leads to arrangements as: $\frac{n!}{k_1!\cdots k_m!}$.

My logical reasoning is that for each set of repeated characters, the total no. of arrangements are divided by the lost arrangements of the repeated ones.

But, if try to have an alternative to the above logic, for the given word, then falter as below:

Considering the two $X$ distinct, leading to $5!$ chances, and subtract from that the chance of taking the arrangements of two $X$.

Divide into two cases:

Case(a): Take two as a block, with ordering not important in that block. This leads to $4!=24$ cases.

This leaves us with $5!= 120 – 24= 96$ cases.

Case (b): The left cases (to be subtracted) come
from the other positions that two $X$ can take, apart from being placed next to each other. There are five such ways to place $X$ seperately.

$X\_—=3$ choices $\times 2=6$,
$\_X\_–=2$ choices $\times 2=4$,
$-\_X\_-= 1\implies 11$ choices for placing the two $X$ seperately, but in each case the three left spaces can be filled with $3\times 2\times 1= 3!$ ways.
So, get $11\times 3!= 66$ ways.
The last case ($-\_X\_-$) has one choice (instead of two), due to clash in one choice with the first case ( $X\_—$) .

But, seems to match need subtract $36$ cases rather than $66$ in Case (b), i.e. $96-36 =60$.

Best Answer

Just following your logic. Say they are $X$ and $Y$ for argument sake -

Case(a): $XY$ together leads to $2 \times 4! = 48$ cases. If they are not distinct, they cannot be permuted within and so you need to subtract $24$ times.

Case (b):

$X \_ − − - \,$ has $3$ choices for $Y$ and so does $Y_ − − − -$ has $3$ choices for $X$ (total of $6$). If they are same, you overcounted $3 \times 3!$ times.

Similarly in $ \_ X \_ − − \,$ you overcount $2 \times 3!$ times.

$− \_ X \_ − $ has only one place of choice for $Y$ and similarly for $− \_ Y \_ − $, there is one choice for $X$. If they are same, you overcounted $1 \times 3!$ times.

If you add them up, you get $36$ cases you need to subtract from $(b)$.

So it is $ 120 - 36 - 24 = 60$.