# Thread: [SOLVED] expected value

1. ## [SOLVED] expected value

Here is my problem:

Find the expected value of g(X) = X^2 - 5X + 3, if the probability density is given by:
f(x) = { $\displaystyle \frac{x}{2} for 0<x<1$
$\displaystyle \frac{1}{2} for 1<x<2$
$\displaystyle \frac{3-x}{2} for 2<x<3$
0 elsewhere

Can anyone help???

2. Originally Posted by penguin11
Here is my problem:

Find the expected value of g(X) = X^2 - 5X + 3, if the probability density is given by:
f(x) = { $\displaystyle \frac{x}{2} for 0<x<1$
$\displaystyle \frac{1}{2} for 1<x<2$
$\displaystyle \frac{3-x}{2} for 2<x<3$
0 elsewhere

Can anyone help???
$\displaystyle E(g(x))=\int_{-\infty}^{\infty} g(x) f(x)~dx$

........... $\displaystyle =\int_0^1 g(x) \frac{x}{2} ~dx + \int_1^2 g(x) \frac{1}{2}~dx + \int_2^3 g(x) \left( \frac{3-x}{2}\right)~dx$

and these are all elementary integrals.

RonL

3. Ok, when I evaluate the integrals, I get $\displaystyle E(g(x)) = -\frac{21}{4}$. Does that look right?

4. Originally Posted by penguin11
Ok, when I evaluate the integrals, I get $\displaystyle E(g(x)) = -\frac{21}{4}$. Does that look right?

No, numerically I get 1.8333, and when I do this exactly I get -22/12.

RonL

5. Thanks! I found my mistake. I really appreciate the help.