# Thread: [SOLVED] Finding expected values and variance

1. ## [SOLVED] Finding expected values and variance

Let x be a random variable with range [-1,1] and f(x). Find mu and the variance for |x|<1

part c) suppose f(x)= 1-|x|

I know the expected value of x, given that function, is the integral from -1 to 1 of x(1-|x|) = integral from -1 to 0 of x-x^2 + the integral from 0 to 1 of x+x^2. I worked this out to find zero.

Variance is E(x^2) - (E(x))^2, which is just E(x^2) in this case since E(X) = 0. I used the integral from -1 to 1 of (x^2)(1-|x|), but when i evaluated it the answer is incorrect. Did I do something wrong? I simplified it to the integral from -1 to 0 of x^2-x^3, plus the integral from 0 to 1 of x^2 + x^3. I got 7/6, but the answer is supposed to be 3/5. Can anyone help? Thanks!

2. Originally Posted by mistykz
Let x be a random variable with range [-1,1] and f(x). Find mu and the variance for |x|<1

part c) suppose f(x)= 1-|x|

I know the expected value of x, given that function, is the integral from -1 to 1 of x(1-|x|) = integral from -1 to 0 of x-x^2 + the integral from 0 to 1 of x+x^2. I worked this out to find zero.

Variance is E(x^2) - (E(x))^2, which is just E(x^2) in this case since E(X) = 0. I used the integral from -1 to 1 of (x^2)(1-|x|), but when i evaluated it the answer is incorrect. Did I do something wrong? I simplified it to the integral from -1 to 0 of x^2-x^3, plus the integral from 0 to 1 of x^2 + x^3. I got 7/6, but the answer is supposed to be 3/5. Can anyone help? Thanks!
I diagree with both answers. I get 1/6:

$E(X^2) = \int_{-1}^0 x^2 (x + 1) \, dx + \int_{0}^1 x^2 (-x + 1) \, dx = \frac{1}{12} + \frac{1}{12}$.

Note: $1 - |x| = 1 + x$ for $x \leq 0$ and $1 - |x| = 1 - x$ for $x > 0$