# variance of uniform distribution

• December 3rd 2011, 09: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).
• December 3rd 2011, 10: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$
• December 3rd 2011, 11:07 AM
Duke
Re: variance of uniform distribution
but surely there is a missing factor of 1/(b-a) on the RHS
• December 3rd 2011, 11:18 AM
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.
• December 3rd 2011, 11:21 AM
Duke
Re: variance of uniform distribution
So does it work out correctly for you ?
• December 3rd 2011, 11:29 AM
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*}
• December 3rd 2011, 11:39 AM
Duke
Re: variance of uniform distribution
so you are saying b^3-a^3=(b-a)(b+a)^2
• December 3rd 2011, 12: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}$
• December 3rd 2011, 03: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~?$