variance of uniform distribution

Let b>a and let X-uniform(a,b) . Prove Var(X) = $\displaystyle (a+b)^2/12$

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

$\displaystyle E(X^2)$=integral from a to b of $\displaystyle 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).

Re: variance of uniform distribution

Quote:

Originally Posted by

**Duke** Let b>a and let X-uniform(a,b) . Prove Var(X) = $\displaystyle (a+b)^2/12$

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

$\displaystyle E(X^2)$=integral from a to b of $\displaystyle 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: $\displaystyle \int_a^b {\frac{{x^2 }}{{b - a}}dx} = \left. {\frac{{x^3 }}{3(b-a)}} \right|_a^b $

Re: variance of uniform distribution

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

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.

Re: variance of uniform distribution

So does it work out correctly for you ?

Re: variance of uniform distribution

Quote:

Originally Posted by

**Duke** So does it work out correctly for you ?

$\displaystyle \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*}$

Re: variance of uniform distribution

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

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.

$\displaystyle E(X)=\frac{a+b}{2}~\&~\text{Var}(X)=\frac{(b-a)^2}{12}$

Re: variance of uniform distribution

Quote:

Originally Posted by

**Duke** Let b>a and let X-uniform(a,b) . Prove Var(X) = $\displaystyle (a-b)^2/12$

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

The expectation is $\displaystyle 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 $\displaystyle 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 $\displaystyle \text{Var}(X)=E(X^2)-(E(X))^2~?$