# Thread: The mean and Variance!

1. ## The mean and Variance!

Hello,

I need some help with this maths problem and I would appreciate if I can have a solution a.s.a.p cause I have to hand in my paper today before midnight.

The problem is about the mean and variance. Here it is:"a continuous random variable X is defined for 0< = X < = 2 and has a probability density function given by f(x)=|1-x|. Calculate the mean and variance of this continous random variable"

'<=' - means greater equal than...

THANK YOU VERY MUCH...

Tom

2. Hello,
Hello,

I need some help with this maths problem and I would appreciate if I can have a solution a.s.a.p cause I have to hand in my paper today before midnight.

The problem is about the mean and variance. Here it is:"a continuous random variable X is defined for 0< = X < = 2 and has a probability density function given by f(x)=|1-x|. Calculate the mean and variance of this continous random variable"

'<=' - means greater equal than...

THANK YOU VERY MUCH...

Tom
So the pdf is |1-x| if x is between 0 & 2.

$\displaystyle \mathbb{E}(X^k)=\int_0^2 x^k f(x) ~dx$
that's a formula you should know...

So $\displaystyle \mathbb{E}(X)=\int_0^2 x |1-x| ~dx$
in order to compute this integral, split it into two integrals : one with the domain where 1-x is positive (and hence |1-x|=1-x), one with the domain where 1-x is negative (and hence |1-x|=-(1-x)=x-1)

Same thing : $\displaystyle \mathbb{V}ar(X)=\mathbb{E}[(X-\mathbb{E}(X))^2]=\int_0^2 (x-\mathbb{E}(X))^2 |1-x| ~dx$

3. Hey dude,

Thank you very much again...

Tom

4. You should use the short cut formula for the variance
$\displaystyle \sigma^2=E(X^2)-(EX)^2$
and you need to break this integral into two pieces,
from (0,1) and (1,2).

5. Actually I tried both of them, but thank you for your hint.