Assume that $A \sim \mathcal{N}(0, 1)$, $B \sim \mathcal{N}(0, 1)$. I am trying to calculate $P(A \,|\, A < B)$.
For the sake of this problem, we can assume that $A \perp B$, but (for obvious reasons) $A \not\perp B | A < B$ (as, in this case, $A, B$ are coupled by a common effect).
I know that I can calculate $P(A < B)$ on its own as follows:
$P(A < B) = \int_{b=0}^\infty\int_{a=0}^b P_A(a)P_B(b) dAdB \tag*{(1)}$
Beyond this, I know that I can rewrite the conditional probability as follows:
$
\begin{align}
P(A \,|\, A < B) = \frac{P(A, A < B)}{P(A < B)} \tag*{(2)}
\end{align}
$
I'm having trouble putting these two pieces together to come up with an expression for $P(A | A < B)$, especially since I cannot factorize the numerator in Equation (2) any further because $A \not\perp A<B$.
Is there a known closed form expression for $P(A | A<B)$? And if so, how is it derived?
Thanks so much in advance for the help!
Edit: this is not a homework problem. 😊
Best Answer
First, we define an additional random variable $C = B - A$, the joint distribution $p(a, b, c)$ is given by $$ p(a, b, c) = \mathcal{N}(0, 1)(a) \ \times \ \mathcal{N}(0, 1)(b) \times \delta(c - (b - a)). $$ Now, we shall focus on the distribution $p(a, c)$, which is given by $$ \begin{aligned} p(a, c) &= \int_{-\infty}^{\infty} db \ \mathcal{N}(0, 1)(a) \ \times \ \mathcal{N}(0, 1)(b) \times \delta(c - (b - a))\\ &= \mathcal{N}(0, 1)(a) \int_{-\infty}^{\infty} db \ \mathcal{N}(0, 1)(b) \times \delta(c - (b - a))\\ &= \mathcal{N}(0, 1)(a) \int_{-\infty}^{\infty} db \ \mathcal{N}(0, 1)(b) \times \delta(c + a - b)\\ &= \mathcal{N}(0, 1)(a) \mathcal{N}(0, 1)(c + a). \end{aligned} $$ Because $A < B$ is equivalent to $C >0$; the probability density $p(a, a < b) = p(a, c > 0)$, which is given by $$ \begin{aligned} p(a, c > 0) &= \int_0^{\infty}dc \ \mathcal{N}(0, 1)(a) \mathcal{N}(0, 1)(c + a)\\ &= \mathcal{N}(0, 1)(a)\int_0^{\infty}dc\mathcal{N}(0, 1)(c + a)\\ &= \mathcal{N}(0, 1)(a)\int_a^\infty dx\mathcal{N}(0, 1)(x)\\ &= \mathcal{N}(0, 1)(a)\left[\frac{1}{2}\left(1 - {\rm erf}\left(\frac{a}{\sqrt{2}}\right)\right)\right], \end{aligned} $$ where ${\rm eft}(x)$ is the error function. Moreover, the distribution $p(c)$ would also be a normal distribution with a variance of $2$ (see here). Therefore $p(c > 0) = 1/2$. The desired distribution $p(a \vert c > 0)$ is then given by $$ \begin{aligned} p(a \vert c > 0) &= \frac{p(a, c > 0)}{p(c > 0)}\\ &= \mathcal{N}(0, 1)(a)\left(1 - {\rm erf}\left(\frac{a}{\sqrt{2}}\right)\right). \end{aligned} $$