Maximizing the sum of the squares of numbers whose sum is constant

2.6k Views Asked by At

I wonder how one goes about to find the maximum of $\sum v_i^2$, the $v_i$'s being positive integers whose sum $\sum_i v_i$ is fixed.

2

There are 2 best solutions below

0
On

If there are two numbers with $1\lt v_j\le v_k$, you can decrease $v_j$ and increase $v_k$ to increase the sum of squares. Thus at most one of the $v_i$ is greater than $1$.

4
On

Imagine that you're aiming to cover as much of the $\sum_i v_i$ square as possible:

enter image description here

The bigger the largest inner square, the closer it gets to covering more of the background square. The maximum sum of squares is reached when all but one of the $v_i$ is at the specified minimum - in this case, $1$.