# variance inequality

Show that. for any discrete random variable X that takes on values in the range [0,1]. Var[X] $\le$ 1/4.

I translate it into a inequality like this: $x_1, x_2, x_3 \cdots ,x_n$ where $0 \le x_i \le 1$, and $p_1, p_2, p_3 \cdots ,p_n$ where $p_1+ p_2+ p_3 \cdots +p_n = 1$, prove that $\sum _1^nx_i^2p_i - (\sum _1^n x_ip_i)^2 \le {1\over 4}$ , how to prove it?

At first I tried cauchy inequatlity, but I fail :(

Here is a way: Note that $$0 \leq X \leq 1$$ $$\Rightarrow 0\leq X^2 \leq X \leq 1$$ Thus $E[X^2] \leq E[X]$

Now thus $$Var[X] \leq E[X](1-E[X])$$

But $0 \leq E[X] \leq 1$, the maxima of $f(x)=x(1-x) \quad x\in [0,1]$ is $1/4$ at $x=.5$ (Hint: AMGM).

QED

• excellent solution!!! when $E[X^2] = E[X] = {1\over2}$, left equals right, are there any other instances as $X_1 = 0$ and $X_2 = 1$ – stonestrong Jun 6 '13 at 9:55
• Is the OP insistent on the method thus provided? I didn't follow the $X_1$ and $X_2$ – Gautam Shenoy Jun 6 '13 at 9:55
• you give a nice solution, although its not a way to prove above inequality I translated – stonestrong Jun 6 '13 at 10:01
• True. Give me some time and i'll see if I can fix that as well. I'll update this answer if I succeed. – Gautam Shenoy Jun 6 '13 at 10:09

First, for every real valued random variable $X$ and every real number $x$, $\mathrm{var}(X)\leqslant E[(X-x)^2]$ (and in fact the variance is the minimum over $x$ of these upper bounds). Second, if $X\in[0,1]$ almost surely, then $(X-\frac12)^2\leqslant\frac14$ almost surely.

For $x=\frac12$, these two facts put together yield $\mathrm{var}(X)\leqslant E[(X-\frac12)^2]\leqslant\frac14$.

• The random variable being discrete or not is irrelevant. – Did Jun 6 '13 at 9:45
• your solution make the situation when left equals to right clear, $(X-{1 \over 2})^2 = {1 \over 2} = E(X)$, it says only equal number of 0 and 1 can achieve it , thanks!! – stonestrong Jun 6 '13 at 10:07
• Indeed this approach shows that the only way to get variance $\frac14$ is that the variance is $E[(X-\frac12)^2]$ and that $(X-\frac12)^2=\frac14$ almost surely. The first condition means that $E[X]=\frac12$, the second that $X\in\{0,1\}$ almost surely. Both together yield that $P[X=1]=P[X=0]=\frac12$ is the only solution. – Did Jun 6 '13 at 10:51