# Vector optimization with vector length as a free variable

I'm trying to solve the following problem:

For a vector $v$ of length $c$, $\min \frac{\sum v[i]^4}{(\sum v[i]^2)^2}$ subject to $\sum v[i] = N$.

I can solve this numerically for a given $c$ using the following command:

Minimize[{Total[z^4]/Total[z^2]^2, Total[z] == N}, z]


Is it possible to solve this problem symbolically leaving $c$ as a free variable?

Isn't this is a problem of mathematics more than programming? Under the stated conditions, by permutation symmetry of the indexes of $v$ all entries of $v$ should be the same (up to absolute value, because in the problem statement all elements are squared). Thus one answer is $v$ is an array of $c$ entries each of which is $n/c$. This solution is confirmed through code for $n = 1, 2$ and $3$.

According to @2012rcampion, these are other solutions for odd $c$:

otherSolutions[c_?OddQ] :=
Permutations[Join[Table[n, {c/2 + 1/2}], Table[-n, {c/2 - 1/2}]]]

• Actually, (at least in the case of three dimensions) there is an alternate solution of $v=\{-n,+n,+n\}$. Mar 28 '15 at 23:57
• Actually, a similar solution should work for all odd dimensionalities. Mar 29 '15 at 0:00

You're like 99% of the way there. You just need to tell Mathematica that z is a vector by feeding it the components:

With[{z = Array[v, 3]},
Minimize[{Total[z^4]/Total[z^2]^2, Total[z] == n}, z]]


For dimensions 1 and 2 the answers are as expected. For 3 (the code above) Minimize outputs a bunch of ugly Roots. So although there is a symbolic solution, there may not be an analytic one.