Confusion about conditional expectation

42 Views Asked by At

I am trying to find $E(|X-c|)$ for constant c. One thing to do is directly use $E(g(X))=\int g(x)f_X(x) dx$ to get $$E(|X-c|) = \int_{-\infty}^{\infty} |x-c|f_X(x)dx =\int_c^\infty (x-c)f_X(x) dx+\int_{-\infty}^c (c-x)f_X(x) dx$$ but another approach is to use $E(X) = E(X|A)P(A)+E(X|A^c)P(A^c)$ for some event $A$ to get \begin{align} E(|X-c|) &=E(|X-c| |X>c)P(X>c)+ E(|X-c| |X \leq c)P(X\leq c)\\ &=\int_c^\infty (x-c)f_X(x) dx \int_c^\infty f_X(t) dt +\int_{-\infty}^c (c-x)f_X(x) dx \int_{-\infty}^c f_X(t) dt. \end{align} These approaches seem to give different results - can anyone point out my mistake?

1

There are 1 best solutions below

2
On BEST ANSWER

What you give as second approach is not correct.

Be aware that: $$\mathbb E(Y\mid A)=\frac{\mathbb E[Y\mathbf1_A]}{P(A)}$$You forgot the division by $P(A)$.