Originally Posted by

**GeoMath** Hi,

If I take two values (A and B) at random from the same normal distribution (mean 0, sd 1), and I know only that A>B. What is the expected value of A?

My simulations suggest it is the mean + 0.56 * sd, but if anyone can help with a closed form solution I would be very grateful.

Thanks

Hi GeoMath!

The probability that "a" is greater than a randomly picked number is $\displaystyle P(a > B) = \text{normalcdf}(a)$, which is the cumulative change to pick a number below "a".

The probability to pick a number between a and a+da is $\displaystyle P(a) = \text{normalpdf}(a)da$.

The probability to pick A>B is equal to the probability to pick A<B, so $\displaystyle P(A>B)=\frac 1 2$.

To calculate the expectation of A, you need:

$\displaystyle P(a | A>B) = \frac{P(A=a \wedge A>B)}{P(A>B)} = \frac{P(a) P(a>B)}{P(A>B)} = \frac{\text{normalpdf}(a)da \cdot \text{normalcdf}(a)}{\frac 1 2}$

So the expectation of A is:

$\displaystyle E(A | A>B) = \int_{-\infty}^{+\infty} a \cdot P(a | A>B) da = \int a \cdot \frac{\text{normalpdf}(a)da \cdot \text{normalcdf}(a)}{\frac 1 2}$

To feed this to Wolfram|Alpha we apparently need that:

$\displaystyle \text{normalpdf}(x) = \frac 1 {\sqrt{2\pi}} \exp(-\frac 1 2 x^2)$

$\displaystyle \text{normalcdf}(x) = \frac 1 2 (1 + \text{erf}(\frac x {\sqrt 2}))$

Then Wolfram|Alpha (link included) gives the result:

$\displaystyle E(A | A>B) = \int_{-\infty}^{+\infty} x \cdot \frac 1 {\sqrt{2\pi}} \exp(-\frac 1 2 x^2) dx \cdot (1 + \text{erf}(\frac x {\sqrt 2}))$

$\displaystyle E(A | A>B) = \frac 1 {\sqrt \pi} \approx 0.56419 $

I believe this matches what you found empirically.