# Maximizing a product of factorials

I would like to maximize $n_1! n_2! \cdots n_k!$ under the constraint $n_1 + n_2 + \cdots + n_k = N$ and $n_i > 0$ for all $i$. Intuitively, I think the maximum occurs when all $n_i$ are $1$ except for one of them: $$(1!)( 1!) \cdots (1!)( (N-(k-1))!)$$ but I am unsure how to show this because I can't take the derivative of this kind of function. Could someone point me in the right direction? Thanks!

Edit: perhaps induction on $k$ will work?

If $k=2$, it is a little easier to see that the maximum of $n_1!n_2!=n_1! (N-n_1)!$ is $N!$ (how to rigorously show this still escapes me). Then it follows by induction, I believe.

• Maybe you could use the more general definition of the factorial using the Gamma Function $\Gamma (n)$. It is differentiable everywhere except for negative integers. – Xoque55 Nov 13 '13 at 15:27
• @Xoque55 I was thinking about that as well, but it seems like overkill for such an innocent-looking problem... is that the only way? – angryavian Nov 13 '13 at 15:28

Since there are only finitely many possibilities for the $n_i$, there is (at least) one configuration that maximises $\prod\limits_{i=1}^k n_i!$.

Now showing that a configuration in which there are at least two $i$ with $n_i > 1$ does not maximise the product yields the conclusion. So suppose there are two (or more) $n_i > 1$. Without loss of generality, assume $n_1 \geqslant n_2 > 1$. Then

$$\frac{(n_1+1)!(n_2-1)!\prod\limits_{i=3}^kn_i!}{\prod\limits_{i=1}^k n_i!} = \frac{n_1+1}{n_2} > 1,$$

so the configuration $(n_1+1,n_2-1,n_3,\dotsc,n_k)$ yields a greater product.

Increasing the largest $n_i$ by 1 and simultaneously decreasing the smallest $n_j$ by 1 respects the condition $n_1 + n_2 + \cdots + n_k = N$ and increases the product. Therefore you can make all of the factors equal to 1 except the biggest one.


• That gives a minimum, not a maximum. – Mikhail Katz Nov 13 '13 at 17:25
• @user72694 $0$ k. I'll check a little later. Thanks. – Felix Marin Nov 13 '13 at 17:48