Conditional expectation $E[X|X>0]$ of standard normal $X \sim \mathcal{N}(0,1)$

Given $X \sim \mathcal{N}(0,1)$, I was wondering what the conditional expectation $E[X|X>0]$ should be?

  1. $E[X|X>0] = \int_0^{\infty} x f(x)dx = \int_0^{\infty}x \frac{1}{\sqrt{2\pi}}e^{-x^2/2} dx$

or

  1. $E[x|X>0] = \int_{-\infty}^{\infty}x \frac{P(X=x,X>0)}{P(X>0)}dx = \frac{\int_{-\infty}^{\infty}x P(X=x)\mathbf{1}\{x>0\}dx}{P(X>0)} = \frac{\int_{0}^{\infty}x P(X=x)dx}{P(X>0)} = \frac{ \int_0^{\infty}x \frac{1}{\sqrt{2\pi}}e^{-x^2/2} dx}{\frac{1}{2}}$

They are off by a scale of $\frac{1}{2}$

Thanks.


Your first attempt actually computes $E[X \mathbf{1}_{X > 0}]$. (Note that you can further simplify and compute the integral by making the substitution $u=x^2/2$.)

In general, $E[X \mid X > 0] = \frac{E[X \mathbf{1}_{X > 0}]}{P(X > 0)}$ which is essentially your second attempt (setting aside the non-rigorousness of using notation like $P(X=x)$).


The "conditional expectation" respect to an event is usually defined as the expectation respect to the conditional distribution. In short: the second is the correct answer.