# Given two independent normal random variables $X$ and $Y$, what is $P(X\leq x\mid X>Y)$?

As the title says, I'm looking for the distribution of $X$ given that $X>Y$.

• Is this for a class? If so, please add the [self-study] tag. Apr 8, 2014 at 12:23
• @gung No, it is not for a class, but my own project.
– Jaho
Apr 8, 2014 at 12:34
• This question can be solved using a result in stats.stackexchange.com/questions/77110, whose answer gives the density of the maximum of $n$ iid Normal variables. More discussion of this circumstance also appears at stats.stackexchange.com/questions/44139.
– whuber
Apr 8, 2014 at 16:20

Assume that $X$ and $Y$ are independent $\mathrm{N}(0,1)$ rv's. Denote by $\phi$ and $\Phi$ the corresponding pdf and df, respectively. By definition, $$P(X\leq x\mid X>Y) = \frac{P(X\leq x,X>Y)}{P(X>Y)} \ \, .$$ Since $X$ and $Y$ are iid, by symmetry we have $P(X>Y)=P(X<Y)$. But we know that $P(X>Y)+P(X<Y)=1$ (the probability of a tie is zero). Hence, $P(X>Y)=1/2$.

Now, \begin{align*} P(X\leq x,X>Y) &= \mathrm{E}[P(X\leq x,X>Y\mid Y)] \quad \text{(total expectation)} \\ &= \int_{-\infty}^\infty P(X\leq x,X>Y\mid Y=y)\,\phi(y)\,dy \\ &= \int_{-\infty}^\infty P(X\leq x,X>y\mid Y=y)\,\phi(y)\,dy \quad \text{(use what you know)} \\ &= \int_{-\infty}^\infty P(y<X\leq x)\,\phi(y)\,dy \quad \text{(independence)} \\ &= \int_{-\infty}^\infty (\Phi(x)-\Phi(y)) I_{(-\infty,x]}(y)\,\phi(y)\,dy \\ &= \Phi^2(x) - \int_{-\infty}^x \Phi(y)\,\phi(y)\,dy \, . \\ \end{align*} Therefore, $$P(X\leq x\mid X>Y) = 2\left(\Phi^2(x) - \int_{-\infty}^x \Phi(y)\,\phi(y)\,dy\right) \, .$$ Integrating by parts, we have $$\int_{-\infty}^x \Phi(y)\,\phi(y)\,dy = \left[\Phi(y)\Phi(y)\right]_{-\infty}^x - \int_{-\infty}^x \Phi(y)\,\phi(y)\,dy \, ,$$ yielding $$\int_{-\infty}^x \Phi(y)\,\phi(y)\,dy = \frac{\Phi^2(x)}{2} \, ,$$ and finally $$P(X\leq x\mid X>Y) = \Phi^2(x) \, .$$

• Note that $\Pr(X\le x|X\gt Y)$ = $\Pr(\max(X,Y)\le x)$ = $\Pr(X\le x\text{ and }Y\le x)$ = $\Phi(x)^2$. This agrees with your result after you perform the final integration using the substitution $z=\Phi(y)$ (no Monte-Carlo needed).
– whuber
Apr 8, 2014 at 18:54
• Thanks! This is much simpler. How would you prove the (intuitively clear) first equality?
– Zen
Apr 8, 2014 at 20:01
• You need (a) exchangeability of $X$ and $Y$ and (b) that $\Pr(X=Y)=0$. It follows immediately that $\Pr(X\gt Y)=\Pr(Y\gt X)=1/2$. A total probability law then gives $\Pr(\max(X,Y)\le x) \\= \Pr(X\le x|X\gt Y)\Pr(X\gt Y)+\Pr(Y\le x|Y\gt X)\Pr(Y\gt X)+\Pr(X\le x|X=Y)\Pr(X=Y)\\ = \Pr(X\le x|X\gt Y)(1/2+1/2)+0\\ = \Pr(X\le x|X\gt Y).\\$ All of this is essentially already in the first few lines of your answer. The remainder (about eight lines) therefore seems to be just a particularly cumbersome way to derive the distribution of the maximum of two continuous iid variables.
– whuber
Apr 8, 2014 at 20:11