2

Problem

I am a software engineer and my friend and I are trying to pick up combinatorics. My friend asked me the following problem. How many ways to form 4 letter word from AAAADDDEEFGG

Attempt

My friend proposed $ 6 \choose 4 $. However, I felt this excluded the following possibilities:

  • Exclude A: $\frac{4!}{3!2!2!}$
  • Exclude D: $\frac{4!}{4!2!2!}$
  • Exclude E or G: $\frac{4!}{4!3!2!}$

  • Exclude F: $\frac{4!}{4!3!2!2!}$

However, when I sketched out the above I felt I was being rather silly since the answer was nonsensical. Please note that I based my approach off this. I clearly think my answer is wrong.

Instead, should I exclude A and realize I have $ 8 \choose 4$ ways to select from the remaining letters? If so, then I believe it be something like $\frac{8 \choose 4}{3!2!2!}$ when excluding A? The cases work similar for D, E, G, and F and I simply sum the results.

If not, can someone please give me a hint so I don't feel embarrassed with myself in the future :) Thanks.

  • All of the posted answers are incorrect. This is a difficult problem. – vadim123 Dec 16 '15 at 15:10
  • It is helpful to think about it in the following way: for each 4 letter word you create you have to do two things. First, choose how many A's, how many D's, how many E's, how many F's and how many G's. Second, you have to choose what order to put them in. There are a number of ways to do step 1, but once you've figured that out, step 2 is easy using multinomial coefficients. – TravisJ Dec 16 '15 at 15:30
  • 1
    The right answer is the coefficient of $x^4/24$ in the product $t(4)t(3)t(2)t(1)t(2)$ where $t(n)$ stands for the polynomial in $\Bbb Q[x]$ obtained by trunctation of the series for $\exp(x)$ after the term $x^n/n!$ (for instance $t(3)=1+x+\frac{x^2}2+\frac{x^3}6$). If I've computed this correctly, the answer is $477$. The accepted answer at the duplicate question explains fairly well why this computation works. – Marc van Leeuwen Dec 16 '15 at 15:49
  • I was not aware of duplication or resource. I read both. I concur and I think this is the correct answer. If you describe this below, I will mark this as the answer. I am simply blown away at this approach however. – GeekyOmega Dec 16 '15 at 16:29

1 Answers1

2

If you ignore the constraints (no more than $3\;D's$, etc. then there would be $5^4=625$ possible ways to do it. ($5$ options for each slot). Now we just have to exclude the ones that use two many of any letter.

Exclude $4\;D's$: $\underline {1}$ case.

Exclude $3\;E's$: First exclude exactly $3$. $4$ ways to place the $E's$, $4$ options for the extra slot so $16$ cases. Now exclude $4$, $1$ case. $\underline {17}$ cases.

Exclude $3\;G's$. Same as with $E's$, $\underline {17}$ cases.

Exclude $2\;F's$: First exclude exactly 2. $\binom 42=6$ ways to place the $F's$, $4^2=16$ ways to populate the remaining two slots. Thus $4*16$ so $\underline {96}$ exclusions. Now we just need to exclude $3$ and $4$, but as we have seen above that is $\underline {17}$ cases

Combining everything we have $$625-1-17-17-96-17=\fbox {477}$$

Note: the above is certainly error-prone, I recommend checking it carefully.With only $625$ raw possibilities a machine could do the count by straight enumeration.

lulu
  • 70,402
  • There are overlaps here. For example, EEEE is being excluded 4 times (same with GGGG). – Seven Dec 16 '15 at 15:36
  • @Seven Sadly possible, but I don't see it. I exclude $EEEE$ in case $2$, where else? – lulu Dec 16 '15 at 15:44
  • @Seven Actually, I fear I didn't exclude $EEEE$ anywhere! On review, my case 2 excludes all words with exactly $3$ $E's$ but not the one with $4$. That is easily fixed...as is the case with $4$ $G's$, but fixing the omissions in the $F's$ is a little nastier. Sad. Haven't time to fix it now, will address it this afternoon. – lulu Dec 16 '15 at 15:47
  • Case 2 excludes all words with 3 E's and anything else in the 4th spot, which means it excludes EEEE as well. But then it does that 4 times, once for each combination of 3 E's. – Seven Dec 16 '15 at 16:18
  • sorry. You are right. I just noticed there are 5 characters, not 4. – Seven Dec 16 '15 at 16:19
  • @Seven I believe I have it right now. – lulu Dec 16 '15 at 17:04