Minimum $L^2$-norm of a vector where entries add up to 1 I want to find those $a_1,...,a_n\in\mathbb{R}$ with $\sum_{i=1}^n a_i =1$, for which 
$$
\sum_{i=1}^n a_i^2 
$$
takes its minimal value. 
I think this should be $a_i=\frac{1}{n}$ for all $i$ and I somehow remember this being proven with the convexity of the $L^2$-norm. But somehow I‘m stuck at trying to do so. 
 A: By Cauchy-Schwarz:
$1=\sum_{i=1}^n a_i =\sum_{i=1}^n 1*a_i \le \sqrt{n}(\sum_{i=1}^n a_i^2)^{1/2}$.
This gives: $\sum_{i=1}^n a_i^2 \ge \frac{1}{n}$. 
With $ a_i=\frac{1}{n}$ for all $i$ we get $\sum_{i=1}^n a_i^2 =\frac{1}{n}$. 
A: Without loss of generality, suppose $a_i \ge 0$ for all $1 \le i \le n$. By the inequality of arithmetic and quadratic means, we have
$$\frac{1}{n} \sum_{i=1}^n a_i \le \sqrt{ \frac{1}{n} \sum_{i=1}^n a_i^2 }$$
with equality if and only if $a_1 = a_2 = \cdots = a_n$. (This can be proved easily using the Cauchy–Schwarz inequality.)
Since $\sum\limits_{i=1}^n a_i = 1$, the left hand side is constant, meaning that the right hand side attains a minimum value when $a_1=a_2 = \cdots = a_n$ ($=a$, say). But then we have
$$\frac{1}{n} = \sqrt{\frac{1}{n} \cdot na^2} = a$$
So indeed the minimum value is attained when $a_i=\frac{1}{n}$ for all $1 \le i \le n$.
A: This is an elegant problem that can be solved in many ways:
a) $\textbf{Cauchy-Schwarz inequality}$:
\begin{align*}
 |<a,1>|^2 &\leq <1,1><a,a> & \text{Cauchy-Schwartz} \\
 \left(\sum{a_i}\right)^2 &\leq \sum{1^2} \cdot \sum{a_i^2} \\
 1 &\leq n \cdot \sum{a_i^2} \\
 \sum{a_i^2} \geq n^{-1}
\end{align*}
Since $\sum{n^{-2}}=n^{-1}$, $a_i=n^{-1}$ is indeed the minimum.
b) $\textbf{Lagrange multipliers}$:
You wish to optimize $f(a) = \|a\|_{2}^{2}$ subject to the constraint $g(a)=<a,1>=1$.
Note that $\nabla f(a) = 2a$ and $\nabla g(a)=1$. By solving $\nabla f(a)= \lambda \nabla g(a)$, you obtain that $a=2^{-1}\lambda$. That is, $a$ is constant. You can check that $a=n^{-1}$ is the only constant $a$'s that satisfies the constraint.
c) $\textbf{Mathematical induction}$: 


*

*Let $n=1$. The only solution is $a_1=1$.

*Assume that the best solution for $n$ is $a_1=\ldots=a_n=n^{-1}$.
Note that
\begin{align*}
 \sum_{i=1}^{n+1}{a_i^2} &= \sum_{i=1}^{n}{\left(p_a \cdot \frac{a_i}{p_a}\right)^2} + \left((1-p_a)\frac{a_{n+1}}{1-p_a}\right)^2
 & p_a = \sum_{i=1}^{n}a_i \\
&= p_a^2 \sum_{i=1}^{n}{\left(\frac{a_i}{p_a}\right)^2} + (1-p_a)^2 \\
&\geq p_a^2 \sum_{i=1}^{n}{n^{-2}} + (1-p_a)^2 & \text{Induction hypothesis} \\
&\geq n^{-1}p_a^2 + (1-p_a)^2 \\
& \geq (n+1)^{-1}
\end{align*}
Since $a_1=\ldots=a_{n+1}$ attains the bound, it is the minimizer.
