# probability calculation with two independent normal RVs

I don't understand why

Probability[X < Y, {X \[Distributed] NormalDistribution[0, 1],
Y \[Distributed] NormalDistribution[0, 1]}]


gives 1/2

while we know that X/Y is Cauchy(0,1) and that

Probability[Z < 1, Z \[Distributed] CauchyDistribution[0, 1]]


gives 3/4

I tried many different approaches and I can't figure out why we have this difference.

• Try Probability[Abs[x] <= 1, x \[Distributed] CauchyDistribution[0, 1]]?
– kglr
Dec 5, 2014 at 23:03
• kguler, this does not even run. I am trying to calculate P(X < Y), I just don't understand where the discrepancy is coming from. In fact, there should not be a reason to take absolute value since X, Y are independent and may be positive or negative Dec 5, 2014 at 23:06
• never mind, this worked: Probability[Z < 1 && Z > -1, Z [Distributed] CauchyDistribution[0, 1]] Dec 5, 2014 at 23:11
• Probability[Abs[Z] < 1, Z [Distributed] CauchyDistribution[0, 1]] ran fine for me, giving 1/2. Dec 6, 2014 at 0:00

Question

If $X \sim N(0,1)$ and $Y \sim N(0,1)$ are independent, how come:

$$P(X<Y) = \frac12 \quad \text{while} \quad P(\frac{X}{Y}<1) = \frac34$$

Nothing to do with Mma. The answer is that the rules of standard algebra do NOT apply to the algebra of random variables, so you cannot simply divide both parts of $P(X<Y)$ by $Y$ ... to get $P(\frac{X}{Y}<1)$ ... , which is what you seem to be doing. Note that $\frac{Y}{Y} \neq 1$, since this denotes the ratio of two random variables (not 2 fixed numbers).
Similarly: $P(X<0) \neq P(X^2<0) \quad$ (The former is $\frac12$; the latter is 0)
P.S. An easy solution to $P(X<Y)$ is:
• Let $Z = (X-Y) \sim N(0, 2)$.
• $P(X<Y) = P(X-Y<0) = P(Z<0) = \frac12$ .