Hello!
Let $x\_1\ge x\_2\ge ... \ge x\_n>0$. Here are two optimization problems:


**P1: Maximize $\Pi \_{i=1}^n x\_i$ subject to $\sum \_{i=1}^n x\_i =K$.**


**P2: Minimize $\sum \_{i=1}^n (x\_i-K/n)^2$.**


As $\sum \_{i=1}^n x\_i =K$, $K/n$ actually is the mean value of $x\_i$. For Problem 1, the maximizer is $x\_1=...=x\_n=K/n$. For Problem 2, the minimizer is also $x\_1=...=x\_n=K/n$. Hence P1 and P2 are equivalent when $x\_i$ can achieve the mean value.


***My question is***: There may exist some other constraints such that $x\_i$ can not reach the mean. Are the two problems still equivalent when $x\_i$ is not able to achieve the mean value? In other words, can P1 and P2 reach optimality simultaneously no matter what other constraints $x\_i$ have.Intuitively $\Pi \_{i=1}^n x\_i$ becomes larger as $x\_i$ approach the mean as close as possible. $\sum \_{i=1}^n (x\_i-\frac{K}{n})^2$ actually is the distance between $x\_i$ and the mean value. Intuituvely I believe they are equivalent, but I am not able to prove it.




---


Edit: Frankly, I am actually interested in the equivalence between P1 and the following P3.


**P3: Minimize $\sum \_{i=1}^n x\_i^2$ subject to $\sum \_{i=1}^n x\_i =K$.**


P2 actually is an intermediate problem. It is easy to show P2 and P3 are equivalent all the time. ($\sum \_{i=1}^n (x\_i-K/n)^2=\sum \_{i=1}^n x\_i^2-2K/n\sum \_{i=1}^n x\_i+K^2/n$). I am trying to prove P1 is equivalent to P2. Of course, it is the best if we can prove P1 is equivalent to P3 directly. But I'm not sure P1 and P3 is equivalent. Intuitively it seems they reach optimality simultaneously. 



Prove two optimization problems are equivalent
**NEW ANSWER**


Now that the problem has been clarified somewhat, under the particular constraint mentioned here, (but not others of a similar nature), the two problems do have the same solution. Let $K,n,\alpha$ be positive with $\alpha \gt \frac{K}{n}$ and consider these optimization problems over non-negative $n$-tuples.


**P1 Maximize $\prod \_{i=1}^n x\_i$ subject to $\sum \_{i=1}^n x\_i =K$ AND $x\_1 \gt \alpha.$**


**P3: Minimize $\sum \_{i=1}^n x\_i^2$ subject to $\sum \_{i=1}^n x\_i =K$ AND $x\_1 \gt \alpha$.**


The common extreme is at $x\_1=\alpha$ and $x\_2=x\_3=\cdots=x\_n=\frac{K-\alpha}{n-1}.$ To see this, consider any other $n$-tuple. If it has $x\_1 \gt \alpha$ then the minimum entry is $x\_n \lt \frac{K-\alpha}{n-1}.$ Replace $x\_1$ by $x\_1-\epsilon$ and $x\_n$ by $x\_n+\epsilon$ where $\epsilon=\min(x\_1-\alpha,\frac{K-\alpha}{n-1}-x\_n)$. Observe that this increases what we want to maximize in **P1** and decreases what we want to minimize in **P2**. In the case that $x\_1=\alpha$ but $x\_2 \gt \frac{K-\alpha}{n-1} \gt x\_n$ we replace $x\_2$ by $x\_2-\epsilon$ and $x\_n$ by $x\_n+\epsilon$ where now $\epsilon=\min(x\_2-\frac{K-\alpha}{n-1},\frac{K-\alpha}{n-1}-x\_n).$ After at most $n$ (strict) improvements by $\epsilon$-moves of this sort we arrive at the claimed $n$-tuple.


Consider non-negative triples with $x\_1+x\_2+x\_3=4.46$ and the constraint that at least one of $x\_1 \ge 2$ or $x\_3 \le 1$ must be true. By an $\epsilon$ argument as above, a maximum for **P1** is at either $\mathbf{x}=(2,1.23,1.23)$ or $\mathbf{y}=(1.73,1.73,1)$ and the same is true of a minimum for **P3**. It turns out that these extremes do not occur at the same place: the maximum for **P1** is at $\mathbf{x}$ since $3.0258 \gt 2.9929$ but the minimum for **P3** is at $\mathbf{y}$ since $7.0258 \gt 6.9858$


Notes:


1. As far as the result, we could also have used this constraint: 
*at least one of* $x\_1,x\_2,x\_3$ *is an integer.*
2. For this example to work with $K$ slightly larger than $4$ requires $4.414 \lt 3+\sqrt{2} \lt K \lt 4.5.$ In my experience (see the example in my old answer below) things are this delicate and using a larger $K$ makes them even more delicate. Another example with $n=3$ is $K=1.2$ with contenders $(0,0.6,0.6)$ and $(0.1,0.1,1).$


General Comments


Dropping the new constraints, The first problem can be equivalently rewritten as


**P1 Maximize $\sum \_{i=1}^n \ln(x\_i)$ subject to $\sum \_{i=1}^n x\_i =K$.**


Then it has the form: Maximize $\sum \_{i=1}^n f(x\_i)$ subject to $\sum \_{i=1}^n x\_i =K$ where $f$ is a *concave* function in the sense that $f(u+\epsilon)+f(v-\epsilon) \gt f(u)+f(v)$ provided $u \lt u+\epsilon \lt v-\epsilon \lt v.$ Other examples include $f(x)=\arctan(x)$ and $f(x)=x^p$ with $0 \lt p \lt 1.$ Note than $\ln(x)=\lim \frac{x^p-1}{p}$ as $p$ approaches $0$ from above.


And **P2** has the form: Minimize $\sum \_{i=1}^n g(x\_i)$ subject to $\sum \_{i=1}^n x\_i =K$ where $g$ is a *convex* function in the sense that $g(u+\epsilon)+g(v-\epsilon) \lt g(u)+g(v)$ provided $u \lt u+\epsilon \lt v-\epsilon \lt v.$ Here we have essentially the $\ell\_2$ norm and $g(x)=|x|^p$ for $p>1$ gives the $\ell\_p$ norm. Another example is $g(x)=x\ln(x)$


Call a replacement of $u \lt v$ by $u+\epsilon \lt v-\epsilon$ an $\epsilon$-*move* and call an $n$-tuple $\epsilon$-*optimal* if no move of this type is possible (subject to any further constraints).
Then any optimization problem as above will attain its extreme value at an $\epsilon$-optiml tuple. So all achieve their extreme value at $x\_1=\cdots=x\_n=\frac{K}{n}$ if that is possible. When there are several $n$-tuples which are optimal in that no further $\epsilon$ moves are possible, then it may be that some optimize one function and others optimize another.


**OLD ANSWER**
I will alter the question and then give an answer of NOT ALWAYS.


I will take the question to be this: Given an $n$-tuple $\mathbf{x}=x\_1,x\_2,\cdots,x\_n$ with $K=\sum \_{i=1}^n x\_i$, let $\alpha(\mathbf{x})=\Pi \_{i=1}^n x\_i$ and $\beta(\mathbf{x})=\sum \_{i=1}^n (x\_i-K/n)^2.$ Suppose we have a set of positive $n$-tuples all with the same sum $K$. We can define a preorder on them by $\mathbf{x} \ge \mathbf{y}$ when $\alpha(\mathbf{x}) \ge \alpha(\mathbf{y})$ OR by $\mathbf{x} \ge \mathbf{y}$ when $\beta(\mathbf{x}) \le \beta(\mathbf{y})$. 



> 
> Question: does $\alpha(\mathbf{x}) \le \alpha(\mathbf{y})$ always imply $\beta(\mathbf{x}) \ge \beta(\mathbf{y})?$
> 
> 
> 


The question is really about the maximal elements in these two orders but we can always make rules to eliminate the ties.


I wish I had a more natural seeming example but: Consider these triples with sum $30$: $\mathbf{x}=[8.1,10.95,10.95]$ and $\mathbf{y}=[9,9,12]$ then $\alpha(\mathbf{x})=971.21025<972=\alpha(\mathbf{y})$ but also $\beta(\mathbf{x})=5.415<6=\beta(\mathbf{y}).$ 


