20

Using the normal distribution. Let $X \sim N(1, 2)$ and $Y \sim N(2, 3)$ where $N(\mu, \sigma^2)$ denotes the normal distribution with mean $\mu$ and variance $\sigma^2$. $X$ and $Y$ are independent.

What is $P(X>Y)$?

I know that $P(X>Y)$ can be translated to mean $P(X-Y>0)$ and I want to make $X-Y$ into one variable such as $D$. So $P(D>0)$ but how do I subtract the distributions? I tried to do $1-2=-1$ for the mean and then $2-3=-1$ for the variance. I do not understand how this can be because we cannot take the square root of -1 to get the standard deviation.

Comp_Warrior
  • 2,075
  • 1
  • 20
  • 35
dataznkid1
  • 201
  • 1
  • 2
  • 4
  • 6
    What has U got to do with this problem? And is this a homework problem (it is useful to know so that the answer can ensure it focuses on teaching you how to solve the problem) – Corvus Feb 21 '13 at 08:21
  • Sorry there was more parts to the problem, but this was just the part that I had difficulty understanding. Yes, it is a homework problem. Thanks for the help! – dataznkid1 Feb 21 '13 at 21:40
  • 2
    It's a bad sign when extraneous material appears in questions: it suggests you are merely copying and not thinking, so your readers accordingly spend equally little time thinking about the problem. I have therefore edited out the reference to $U$. – whuber Feb 21 '13 at 22:19
  • Sorry I am new to this! But I tried to work out some of the problem in the comment below. – dataznkid1 Feb 21 '13 at 22:23

4 Answers4

20

This question is now old enough that I can give you a solution without ruining your homework. As you have pointed out in your question, to compute this probability, you need to find the distribution of $D=X-Y$. One of the properties of the normal distribution is that any linear combination of independent normal random variables is also a normal random variable, so this establishes that $D \sim \mathcal{N}$, and it remains only to find the mean and variance of this random variable. You have correctly derived the mean, but incorrectly derived the variance.

To obtain the mean and variance of $D$ we apply standard rules for the mean and variance of linear functions of random variables. Since the mean is a linear operator and the variance is a quadratic operator, we have:

$$\mathbb{E}(D) = \mathbb{E}(X-Y) = \mathbb{E}(X) - \mathbb{E}(Y) = 1-2 = -1.$$

$$\mathbb{V}(D) = \mathbb{V}(X-Y) = \mathbb{V}(X) + (-1)^2 \mathbb{V}(Y) = 2+3 = 5.$$

Thus, you have the probability:

$$\begin{equation} \begin{aligned} \mathbb{P}(X>Y) = \mathbb{P}(X-Y>0) &= \mathbb{P}(D>0) \\[6pt] &= \mathbb{P} \bigg( \frac{D+1}{\sqrt{5}} > \frac{0+1}{\sqrt{5}} \bigg) \\[6pt] &= 1-\Phi \bigg( \frac{0+1}{\sqrt{5}} \bigg) \\[6pt] &= 0.3273604, \\[6pt] \end{aligned} \end{equation}$$

where $\Phi$ denotes the cumulative distribution function for the standard normal distribution.

Ben
  • 91,027
  • 3
  • 150
  • 376
  • Can I just say more simply that (−) = (+) ? – Ben Wilde Apr 22 '21 at 22:35
  • 1
    That is true for uncorrelated random variables, but it is not true in general, so be careful. – Ben Apr 22 '21 at 23:36
  • @Ben Can you please explain the logic/basics behind the steps following P(D>0), where you subtract the mean and divide with variance for both RHS, LHS and then reason behind simplifying it further with 1- ....... I assume its because you convert RHS to standard normal variable and then to find P(standard normal variable)> some value, you do 1- "cumulative distribution until the value", isn't it ? – tjt Jan 30 '22 at 04:15
9

Ok, since this is homework, you get hints instead if straight answers.

Rather than thinking about $P(X>Y)$ why not think about $P(X-Y>0)$. This is clearly the same probability yes? So now you just need to work out the distribution of $Z=X-Y$

Do you know how to do that?

Edit

Ok, so your problem is with the distribution of the difference. Try this:

If $Y \sim N(1,2)$ then what is the distribution of $2Y$? Well, we double the mean and multiply the variance by $2^2$, so $Y \sim N(2,8)$. Notice that this ensures that the spread of the distribution (standard deviation) has doubled, which makes sense. Now you know how to add random variable so what happens if you do $Z = X + (-Y)$ instead?

(In fact this is basically the same argument as pointed out in an older question by Dilip Sarwate: https://stats.stackexchange.com/a/31328/6633)

Alf Pascu
  • 183
  • 1
  • 5
Corvus
  • 4,573
  • 1
  • 27
  • 58
  • 2
    Oh sorry, I forgot to mention the work I did. Thanks for the update! Sorry, this is new to me. I know that P(X>Y) can be translated to mean P(X-Y>0) and I want to make X-Y into one variable such as D. So P(D>0) but how do I subtract the distributions? I tried to do 1-2=-1 for the mean and then 2-3=-1 for the variance? I do not understand how this can be because we cannot take the square root of -1 to get the standard deviation. Thanks! – dataznkid1 Feb 21 '13 at 22:23
  • 1
    I love this comment! Please consider moving it into your question as an edit, because it will show people exactly where you're stuck and what you need to know to move forward. (+1 for the question now.) – whuber Feb 21 '13 at 22:26
  • 2
    @dataznkid1 See [this answer](http://stats.stackexchange.com/a/31328/6633) to understand why the variances add instead of subtracting. – Dilip Sarwate Feb 21 '13 at 22:26
  • Oh, so you add the variances instead. However, is the mean still equal to -1? I am not sure about the negative mean. Do I add this as well? And the variance is equal to 5? So D~N(-1,5)? – dataznkid1 Feb 21 '13 at 22:31
  • @dataznkid1 correct – Corvus Feb 21 '13 at 22:39
  • But can the mean be equal to -1? I am not sure what this means or represents. Pardon the pun. – dataznkid1 Feb 21 '13 at 22:47
  • No @dataznkid1 you were correct the first time, the variance of X is 2 and the variance of Y is 3, so the variance of $X-Y$ is $2 + (-1)^2 \times 3 = 2 + 3 = 5$ – Corvus Feb 21 '13 at 22:48
  • Yes the mean can be equal to -1. In Moscow the average temperate in March is -1 degree Celsius – Corvus Feb 21 '13 at 22:50
  • Ah I see. Sorry if that was a dumb question. With the prior information, I did > pnorm(0,mean=-1,sd=sqrt(5)) [1] 0.6726396 So the probability is 67% that P(X>Y)? It seems like a high value to me considering that the mean of X is less than Y? – dataznkid1 Feb 21 '13 at 22:53
  • Pnorm(z) is giving you $P(Z < z)$, I.e. the left tail. You want the right (i.e. >) so you need to do 1-pnorm. Well done for using your intuition/common sense to spot the problem. – Corvus Feb 22 '13 at 06:09
  • @dataznkid1, if this issue is now resolved for you, you should *accept* this answer by clicking the check mark below the vote total. You may want to *upvote* this answer as well. These actions acknowledge Corone's efforts to help you, & are a polite way to say thank you. – gung - Reinstate Monica Sep 05 '13 at 16:25
  • Pretty sure s/he's long gone @gung. Looks like this person signed up to ask this question and hasn't been seen since. – Macro Sep 05 '13 at 16:33
  • 1
    Probably true, @Macro, but if he ever comes back to ask another Q, he'll see that comment. Maybe it'll help, maybe it won't... – gung - Reinstate Monica Sep 05 '13 at 16:36
1

$D=X-Y$ is normal with mean $-1$ and variance $2+3$. Knowing the distribution of $D$, you can calculate required probability.

gung - Reinstate Monica
  • 132,789
  • 81
  • 357
  • 650
Munir
  • 11
  • 1
-1

I think this should work.

In general, suppose $X$ has distribution function $\mathbb{G}(x)$, and $Y$ has distribution function $\mathbb{H}(x)$ and $X$ and $Y$ are independent. We need to find the probability $P(X>Y)$.

Now, for some constant $\alpha$, $P(Y<\alpha)=\mathbb{H}(\alpha)$. Therefore, $P(Y<X)=\int_{x}\mathbb{H}(\alpha)d\mathbb{G}(\alpha)$.