Combinatorics of given alphabet

246 Views Asked by At

I'm looking for the formula to determine the number of possible words that can be formed with a fixed set of letters and some repeated letters. For instance take the 8-letter word SEASIDES and find out how many possible anagrams can be made: there are 3x S, 2x E, and 1 each of A, I and D; words of less than 8 letters are allowed.

The formula for all 8 letters is not too difficult W8 = 8! / (3! * 2!). However, this doesn't include shorter anagrams, which seem a less intuitive formula.

2

There are 2 best solutions below

4
On BEST ANSWER

You can solve this problem using exponential generating functions. For any $k$, $0\le k \le 8$, the number of anagrams of $k$ letters chosen from SEASIDES is given by the coefficient of $x^k/k!$ in the polynomial $$\begin{align}p(x) &=\left(1+x+\frac{x^2}{2!}+\frac{x^3}{3!}\right)\left(1+x+\frac{x^2}{2!}\right)(1+x)^3\\ &=\frac{x^8}{12}+\frac{2 x^7}{3}+\frac{8 x^6}{3}+\frac{41 x^5}{6}+\frac{143 x^4}{12}+\frac{85 x^3}{6}+11 x^2+5 x+1. \end{align}$$ Summing from $k=0$ to $8$ gives $9859$. (As a check, this gives the counts for $7$ and $8$ as $(2/3)7!$ and $(1/12)8!$, which are both equal to $3360$, as @Henry observed.)

A convenient compact notation for this answer is $$\sum_{k\ge0}\frac{d^k}{dx^k}p(x)\bigg|_{x=0} = 9859;$$ the sum actually terminates at $k=\deg p(x)=8$.

4
On

You can use $$\displaystyle \sum_{s=0}^3 \sum_{e=0}^2 \sum_{a=0}^1 \sum_{i=0}^1 \sum_{d=0}^1 \dfrac{(s+e+a+i+d)!}{s!\,e!\,a!\,i!\,d!}$$ and if you like ignore the $ a!\,i!\,d!$ which is always $1$. This will give $9859$ possibilities. You may want to subtract $1$ if you want to exclude $0$-letter anagrams, leaving $9858$ possibilities.

For the full $8$-letter anagrams, each index takes its maximum value, giving $\frac{8!}{3! \, 2!}=3360$ possibilities. It seems there are another $3360$ $7$-letter anagrams (is this a co-incidence?), so between them more thatn two-thirds of the total.