Palindromes with restrictions

621 Views Asked by At

How many $11$ character palindromes can I make if I have a restriction that one letter repeats $3$ times, one letter repeats $4$ times, and two pairs of letters repeat $2$ times?

I thought it's $$\frac{26!}{22!} \times 3$$

since we need to pick $4$ letters essentially (5th one is determined by one of the letters we pick, as there are $4$ repeats for one of the letters) and the multiplication follows from the fact than any of the other letters could be repeated $3$ times and thus be in the center.

Could someone confirm this or point me to my mistake?

1

There are 1 best solutions below

0
On BEST ANSWER

It’s a little harder than that. Let’s imagine picking first the letter that’s used $4$ times, then the one that’s used $3$ times, and finally the two that are used twice each: there are $26$ ways to make the first choice, $25$ ways to make the second choice, and then $\dbinom{24}{2}$ ways to choose the last two letters, for a total of $$26\cdot 25 \binom{24}{2} = \frac{26\cdot 25\cdot 24\cdot 23}{2}$$ ways to choose the four letters and decide how many times each will appear.

Now we have to count the number of ways to make a palindrome from the $11$ letters that we’ve chosen. Let me call the letters $w,x,y$, and $z$, where $w$ will appear four times, $x$ will appear three times, and $y$ and $z$ will appear twice each. As you observed, an $x$ has to go in the middle; once that’s been taken care of, we have to have two $w$’s, one $x$, one $y$, and one $z$ on each side of that middle $x$. Since we’re building a palindrome, the five letters to the right of the centre $x$ must be the mirror image of the five on the left, so there will be one palindrome for every way of arranging two $w$’s, one $x$, one $y$, and one $z$. I can put the $x$ in any of $5$ places. Once that’s done, the $y$ can go in any of $4$ places, and then the $z$ can go in any of $3$ places. The $2$ $w$’s will necessarily go in the remaining two slots, so there are $5 \cdot 4 \cdot 3$ ways to arrange the five letters and therefore $5 \cdot 4 \cdot 3$ palindromes that can be made from the $11$ letters that we chose.

Putting the pieces together, we get a grand total of

$$\begin{align*}26\cdot 25 \binom{24}{2} &= \frac{26\cdot 25\cdot 24\cdot 23}{2} \cdot 5 \cdot 4 \cdot 3\\ &= \frac{26\cdot 25\cdot 24\cdot 23\cdot 5 \cdot 4 \cdot 3}{2} \end{align*}$$

palindromes.