P r o j e c t s

          N o t e s

         I n f o r m a t i o n
         g i t h u b

Maximum of Variance

    Suppose that a vector `x in mathbb{R^n}` consists of the elements which are in `[0, c]` for a positive real number `c`. Then
\sum_{i=1}^n x_i^2 \leq \sum_{i=1}^n c x_i = c \sum_{i=1}^n x_i = c n \bar{x}
where `bar{x}` is the mean of `x` elements. Let `Var(x)` be the variance of `x` elements, then
\begin{align} Var(x) &= \frac{1}{n} \sum_{i=1}^n (x_i - \bar{x})^2 = \frac{1}{n} \sum_{i=1}^n (x_i^2 - 2\bar{x} x_i + \bar{x}^2) \\ &= \frac{1}{n} \left\{ \sum_{i=1}^n x_i^2 - 2\bar{x} \sum_{i=1}^n x_i + n \bar{x}^2 \right\} = \frac{1}{n} \left\{ \sum_{i=1}^n x_i^2 - 2n \bar{x}^2 + n \bar{x}^2 \right\} \\ &= \frac{1}{n}\left\{ \sum_{i=1}^n x_i^2 - n \bar{x}^2 \right\} \leq \frac{1}{n} (c n \bar{x}  - n \bar{x}^2) = c \bar{x} - \bar{x}^2
    If we define `f(bar{x})=cbar{x}-bar{x}^2`, then its extreme value is as follows:
f(\bar{x}) = c \bar{x} - \bar{x}^2 \\
f^{\prime}(\bar{x}) = c - 2\bar{x} = 0 \Rightarrow \bar{x} = \frac{c}{2} \\
f\left( \frac{c}{2} \right) = \frac{c^2}{2} - \frac{c^2}{4} = \frac{c^2}{4}  
    It yields the following boundary.
Var(x) \leq c\bar{x} - \bar{x}^2 \leq \frac{c^2}{4}