# variance of uniform distribution

• Dec 3rd 2011, 10:59 AM
Duke
variance of uniform distribution
Let b>a and let X-uniform(a,b) . Prove Var(X) = $(a+b)^2/12$

Var(X)= E(X^2)-E(X)^2

$E(X^2)$=integral from a to b of $x^2/(b-a) = (b^3-a^3)/b-a$

I know E(X)= (b-a)/2 so E(X^2) must be wrong as when I subtract I do not get required Var(X).
• Dec 3rd 2011, 11:23 AM
Plato
Re: variance of uniform distribution
Quote:

Originally Posted by Duke
Let b>a and let X-uniform(a,b) . Prove Var(X) = $(a+b)^2/12$

Var(X)= E(X^2)-E(X)^2

$E(X^2)$=integral from a to b of $x^2/(b-a) = (b^3-a^3)/b-a$

I know E(X)= (b-a)/2 so E(X^2) must be wrong as when I subtract I do not get required Var(X).

Consider this: $\int_a^b {\frac{{x^2 }}{{b - a}}dx} = \left. {\frac{{x^3 }}{3(b-a)}} \right|_a^b$
• Dec 3rd 2011, 12:07 PM
Duke
Re: variance of uniform distribution
but surely there is a missing factor of 1/(b-a) on the RHS
• Dec 3rd 2011, 12:18 PM
Plato
Re: variance of uniform distribution
Quote:

Originally Posted by Duke
but surely there is a missing factor of 1/(b-a) on the RHS

Yes. I edited it.
• Dec 3rd 2011, 12:21 PM
Duke
Re: variance of uniform distribution
So does it work out correctly for you ?
• Dec 3rd 2011, 12:29 PM
Plato
Re: variance of uniform distribution
Quote:

Originally Posted by Duke
So does it work out correctly for you ?

\begin{align*}\frac{b^3-a^3}{3(b-a)}-\frac{(b+a)^2}{4}&=\frac{4(b^2+ab+a^2)-3(b^2+2ab+a^2)}{12}\\&=\frac{b^2-2ab+a^2}{12} \end{align*}
• Dec 3rd 2011, 12:39 PM
Duke
Re: variance of uniform distribution
so you are saying b^3-a^3=(b-a)(b+a)^2
• Dec 3rd 2011, 01:12 PM
Plato
Re: variance of uniform distribution
Quote:

Originally Posted by Duke
so you are saying b^3-a^3=(b-a)(b+a)^2

NO. You have two mistakes in the OP.

$E(X)=\frac{a+b}{2}~\&~\text{Var}(X)=\frac{(b-a)^2}{12}$
• Dec 3rd 2011, 04:18 PM
Plato
Re: variance of uniform distribution
Quote:

Originally Posted by Duke
Let b>a and let X-uniform(a,b) . Prove Var(X) = $(a-b)^2/12$

The pdf is $f_X=\frac{x}{b-a}$

The expectation is $E(X)=\int_a^b {x \cdot f_X dx} = \frac{1}{{b - a}}\int_a^b {xdx} = \frac{1}{{b - a}}\frac{{b^2 - a^2 }}{2} = \frac{{b + a}}{2}$.

Then $E(X^2)= \int_a^b {x^2 \cdot f_X dx} = \frac{1}{{b - a}}\int_a^b {x^2dx} = \frac{1}{{b - a}}\frac{{b^3 - a^3 }}{3} = \frac{{b^2 + ba+ a^2}}{3}$.

Now what is $\text{Var}(X)=E(X^2)-(E(X))^2~?$