2

$$(E(X))^2 = \left( \int_{-\infty}^{+\infty}xf(x) \, dx \right)^2 \le \int_{-\infty}^{+\infty}x^2(f(x))^2 \, dx \le \int_{-\infty}^{+\infty} x^2f(x) \, dx = E(X^2)$$

Because of cauchy-schwarz inequality and $f(x) \le 1$. Is my solution correct?

George
  • 543
  • 1
    and similarly for discrete type – George Aug 06 '15 at 01:28
  • 2
    By definition, Variance is $E\left[(X-E[X])^2\right]$. – lulu Aug 06 '15 at 01:31
  • Why does $f(x) \leq 1$? take the exponential distribution with parameter 5. Then $f(x) = 5 e^{-5x} \mathbb{1}_{\mathbb{R}^+}(x)$ that is $> 1$ for some $x$ – Tryss Aug 06 '15 at 01:32
  • @Tryss isn't $f(x) \le 1$ necessary for $f$ to be a p.d.f? – George Aug 06 '15 at 01:32
  • I think i misused cauchy's inequality as I don't remember it anymore, but i remember a similar inequality. sorry – George Aug 06 '15 at 01:33
  • $f(x)≤1$ isn't even true for uniform distributions, if the support is small. – lulu Aug 06 '15 at 01:34
  • If $xf(x)$ is a real number then the integral will be real and the square of a real number is nonnegative. – Tucker Aug 06 '15 at 01:34
  • @lulu but why is then $v(x) \ge 0$? – George Aug 06 '15 at 01:34
  • @George : No. Take the uniform distribution on $[0, \frac{1}{2}]$, then $f(x) = 2$ on $[0, \frac{1}{2}]$ – Tryss Aug 06 '15 at 01:34
  • so how do I prove it then? – George Aug 06 '15 at 01:36
  • 2
    Variance is non-negative for the reason I gave in my first comment. It is the expectation of a non-negative quantity. As an exercise, it's good to verify that the definition I gave is equivalent to the one you implicitly used ($E\left[X^2\right]-E\left[X\right]^2$) – lulu Aug 06 '15 at 01:36
  • @lulu thanks I got it. but if I want to use the second definition how do I prove it? – George Aug 06 '15 at 01:38
  • Cauchy Schwarz works fine, just apply it to $X\sqrt{f(x)}$ instead of $X$ Note: even though $f(x)$ can get above $1$, it still can't ever be negative! – lulu Aug 06 '15 at 01:56

1 Answers1

6

Let $\mu=\operatorname{E}(X)$. The variance is $\operatorname{var}(X) = \operatorname{E}((X-\mu)^2)$. That is non-negative because it's the expectation of a nonnegative random variable. Now notice that \begin{align} & \operatorname{var}(X) = \operatorname{E}((X-\mu)^2) \\[10pt] = {} & \operatorname{E}(X^2 -2\mu X + \mu^2) \\[10pt] = {} & \operatorname{E}(X^2) - 2\mu\operatorname{E}(X) + \mu^2 \\[10pt] = {} & \operatorname{E}(X^2) - 2\mu^2 + \mu^2 \\[10pt] = {} & \operatorname{E}(X^2) - \mu^2. \end{align} If the question is how to prove that that last expression is nonnegative, then one way to prove it is by seeing, as above, that it's equal to the first expression above.

  • it is intuitive but not entirely clear to me why expectation of non negative random variable is non negative. – chesslad Feb 15 '20 at 16:21
  • @Abhay If the random variable is non-negative, how could its expectation -- sampled/integrated over the space in which it's non-negative -- be negative? – andybuckley Mar 03 '20 at 21:58