While trying to solve a problem in graph theory I need to find the maximum value of $x_1^2+x_2^2+\dots +x_k^2$ subject to a condition that $x_1+x_2+\dots + x_k=n$.
Could someone guide me how to do this?
Thanks in advance.
While trying to solve a problem in graph theory I need to find the maximum value of $x_1^2+x_2^2+\dots +x_k^2$ subject to a condition that $x_1+x_2+\dots + x_k=n$.
Could someone guide me how to do this?
Thanks in advance.
There is no maximum. Consider for example the points $$(r,n-r,0,\ldots,0)$$ for $r\to\infty$.
However, there is a minimum, as pointed out in another answer.
The constraint describes a hyperplane perpendicular to the vector $(1,1,\cdots1)$. The isosurfaces of the objective function are hyperspheres centered at the origin.
Hence the solution
$$\frac nk(1,1,\cdots1).$$
If the $x_k$ are subject to the additional constraint $x_k \geq 0$, then the maximum value happens at $(n, 0, \dots 0)$ (and the other $k-1$ points of all $n$ and $0$). If they can be arbitrary real values, there is no maximum.
– Daniel Martin Nov 03 '17 at 11:24