4
$\begingroup$

I can see how one can compute the variance of a uniform distribution on $[a,b]$ using

$$ Var[X] = E[X^2] - E[X]^2 = \frac{(b-a)^2}{12}$$

as explained e.g. here: http://www.statlect.com/probability-distributions/uniform-distribution

However, how does one compute it using

$$ Var[X] = E[(X - E[X])^2] $$ ?

My approach would be transform $(X-E[X])^2$ to a new random variable $Y$ which follows a cdf $$G(y) = P(Y < y) = P((X-E[X])^2 < y) = P(X < \sqrt{y} + E[X]) = \frac{\sqrt{y} + E[X]-a}{b-a} $$

whenever $\sqrt{y} + E[X] \in [a,b]$, i.e., $y \in [a_Y, b_Y]$ where $a_Y = (\frac{3a-b}{2})^2$ and $b_Y = (\frac{b+a}{2})^2 $, and 0 otherwise.

Thus $g(y) = \frac{1}{2(b-a)\sqrt{y}}$ for $y \in [a_Y, b_Y]$ and 0 otherwise.

And then I would compute $$Var[X] = E[(X - E[X])^2] = E[Y] = \int_{a_Y}^{b_Y} y g(y) dy = \frac{1}{2(b-a)} \int_{a_Y}^{b_Y} \sqrt{y} dy$$

which does not yield the desired result.

What goes wrong with my transformation?

$\endgroup$
2
  • 1
    $\begingroup$ You could just use the law of the unconscious statistician $\operatorname{E}[g(X)] = \int_{-\infty}^\infty g(x) f_X(x) \, dx $ where $g$ is $(X-\mu)^2$ $\endgroup$
    – Glen_b
    Commented Apr 12, 2016 at 16:54
  • 1
    $\begingroup$ Err..., $Y = (X-E[X])^2 =\left (X-\frac{a+b}{2}\right)^2$ takes on values in $\left[0,\left(\frac{b-a}{2}\right)^2\right]$ and not what you have written. $\endgroup$ Commented Apr 12, 2016 at 17:00

1 Answer 1

1
$\begingroup$

However, how does one compute it using $Var[X] = E[(X - E[X])^2]$?

You could just use the law of the unconscious statistician
$\operatorname{E}[g(X)] = \int_{-\infty}^\infty g(x) f_X(x) \, dx $ where $g$ is $(X-\mu)^2$

What goes wrong with my transformation?

Well, this is wrong, for one thing:

$P((X-E[X])^2 < y) = P(X < \sqrt{y} + E[X]) $

$\endgroup$
2
  • $\begingroup$ What exactly is wrong with that $P(X \ldots)$ ? $\endgroup$
    – bonifaz
    Commented Apr 12, 2016 at 18:21
  • 1
    $\begingroup$ @bonifaz For a similar example, consider the distinction between $P(Z^2<2)$ and $P(Z<\sqrt{2})$ (if it helps, you could imagine $Z$ to be standard normal). If you still don't see it, draw a picture. $\endgroup$
    – Glen_b
    Commented Apr 13, 2016 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.