Using lagrange multiplier to find maximum of $f(p_1, ..., p_n, \lambda) = \prod_{i=1}^n p_i + \lambda \left(\sum_{i=1}^n p_i - c\right)$

94 Views Asked by At

I'm trying to find the $p_i$ and $\lambda$ values that maximize the function $$f(p_1, ..., p_n, \lambda) = \prod_{i=1}^n p_i + \lambda \left(\sum_{i=1}^n p_i - c\right)$$ such that $p_i > 0$ and $\sum_{i=1}^n p_i = c$.

Using Lagrange multiplier, we have $$log f(p_1, ..., p_n, \lambda) = \sum_{i=1}^n log p_i + \lambda \left(\sum_{i=1}^n p_i - c\right)$$ I first try to solve for $p_i$ $$\frac{\partial log f}{\partial p_i} = \frac{1}{p_i} + \lambda $$ I set the above expression to 0 and solve for $p_i$ $$\Rightarrow p_i = -\frac{1}{\lambda}$$. Using the constraint, $\sum_{i=1}^n p_i = c$, we have that $$\sum_{i=1}^n p_i = -\sum_{i=1}^n \frac{1}{\lambda} = c$$ $$\Rightarrow \lambda = -\frac{n}{c} $$ $$\Rightarrow p_i = \frac{c}{n}$$

However, I don't think this is correct. $\lambda = (-\frac{c}{n})^{n-1}$ is a maximum of the function $f$, not $\lambda = -\frac{n}{c}$.

2

There are 2 best solutions below

2
On BEST ANSWER

If $p_i = \frac{c}{n}$, then the product would be $\left( \frac{c}{n}\right)^n$.

We know the result is correct from AM-GM inequality.

Edit:

Suppose we work with the original function directly, taking partial derivative with $p_i$ gives us

$$\prod_{j \ne i}p_j + \lambda =0$$

Multiply $p_i$ gives us $$\prod_{j=1}^n p_j =-\lambda p_i$$

Hence all the $p_i$ are equal and hence $$-{p_1}^{n-1}=\lambda$$

or $$-\left( \frac{c}{n}\right)^{n-1}=\lambda$$

0
On

Your problem is to maximize $\prod p_i$ given that $\sum p_i = c$ which is equivalent to maximizing $\log (\prod p_i) = \sum \log p_i$ given that $\sum p_i = c$. So, the new objective function is $\sum \log p_i + \lambda (\sum p_i - c).$ The rest is standar calculation.