# Thread: variance of uniform distribution

1. ## 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).

2. ## Re: variance of uniform distribution

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$

3. ## Re: variance of uniform distribution

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

4. ## Re: variance of uniform distribution

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

5. ## Re: variance of uniform distribution

So does it work out correctly for you ?

6. ## Re: variance of uniform distribution

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*}

7. ## Re: variance of uniform distribution

so you are saying b^3-a^3=(b-a)(b+a)^2

8. ## Re: variance of uniform distribution

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}$

9. ## Re: variance of uniform distribution

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~?$

,

,

,

### show that variance=[b-a]^2/12

Click on a term to search for related topics.