TITLE: Maximum of the Variance Function for Given Set of Bounded Numbers
QUESTION [8 upvotes]: Let $ \boldsymbol{x} $ be a vector of $n$ numbers in the range $ \left[0, c \right] $, where $ c $ is a positive real number.
What's is the maximum of the variance function of this $ n $ numbers?
Maximum in the meaning what spread of the number will maximize the variance?
What would be a tighter bound for other assumptions on the spread of the numbers.
The variance of the vector $ \boldsymbol{x} $ is given by:
$$ \operatorname{var} (\boldsymbol{x}) = \frac{1}{n} \sum_{i = 1}^{n} {\left( {x}_{i} - \overline{\mathbf{x}} \right )}^2 $$
Where the mean $\overline{\boldsymbol{x}}$ is given by:
$$ \overline{\boldsymbol{x}} = \frac{1}{n} \sum_{i = 1}^{n} {x}_{i} $$

REPLY [2 votes]: An easier derivation can be done as follows (From [1]):
For any constant $c$, we have,
\begin{equation}
E[(X-c)^2] = E[X^2] - 2E[X]c + c^2
\end{equation}
The above quadratic is minimized when $c=E[X]$. It follows that,
\begin{equation}
\sigma^2 = E[(X-E[X])^2] \leq E[(X-c)^2], \text{for all } c
\end{equation}
By letting $c = (a+b)/2$, we obtain,
\begin{equation}
\sigma^2 \leq E\left[\left(X-\frac{a+b}{2}\right)^2\right] = E[(X-a)(X-b)] + \frac{(b-a)^2}{4} \leq \frac{(b-a)^2}{4}
\end{equation}
since for $x$ in $[a,b]$, $(x-a)(x-b)<0$
Further, the bound could be very conservative. However, in the absence of any other information about $X$, it can not be improved.
[1]  D. P. Bertsekas and J. N. Tsitsiklis, Introduction to Probability. Athena
Scientific, 2002.