Main content

## Statistics and probability

### Course: Statistics and probability > Unit 9

Lesson 4: Combining random variables- Mean of sum and difference of random variables
- Variance of sum and difference of random variables
- Intuition for why independence matters for variance of sum
- Deriving the variance of the difference of random variables
- Combining random variables
- Combining random variables
- Example: Analyzing distribution of sum of two normally distributed random variables
- Example: Analyzing the difference in distributions
- Combining normal random variables
- Combining normal random variables

© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# Example: Analyzing the difference in distributions

AP.STATS:

VAR‑5 (EU)

, VAR‑5.E (LO)

, VAR‑5.E.1 (EK)

, VAR‑5.E.3 (EK)

Finding the probability that a randomly selected woman is taller than a randomly selected man by understanding the distribution of the difference of normally distributed variables.

## Want to join the conversation?

- why do we use man minus woman?and not woman minus man?(3 votes)
- That is a great question.

In the video we have D = M - W and the Z-score of -0.8 gives P(D < 0) = 0.2119 under the N(8, 100) distribution.

If we define D = W - M our distribution is now N(-8, 100) and we would want P(D > 0) to answer the question. Our Z-score would then be 0.8 and P(D > 0) = 1 - 0.7881 = 0.2119, which is same as our original result.

The difference between the approaches is which side of the curve you are trying to take the Z-score for.(10 votes)

- I don't understand why did we set the probability P(D<0)?(6 votes)
- D is the difference between men and women's height: M-W.

If D is less than 0 ie. negative than that would mean the woman was taller than the man. Man 170 cm Women 175 cm D = M-W D = 170-175 D = -5.(4 votes)

- it would make more sense that D=W-M because we are looking for the probability of women being taller than men!(2 votes)
- Sorry what if we don't have TI 84 calculator tool? how do you do it manually? without calculator ? thanks(2 votes)
- You can do it manually by consulting a z-score table (e.g., http://users.stat.ufl.edu/~athienit/Tables/Ztable.pdf). You find the cross section that matches your z-score, and it will give you what his calculator just did.(0 votes)

- For combining for normally distributed variables, the independence clause needs to be there? Since variance is the spread of the data.(2 votes)
- 1. for mean, no need. you can just add or subtract each of means

2. but for variance and standard deviation, we have to consider the independence between them. cause there's a concept of "co"variance when they are dependent on one another, which means some parts of their values vary together. you can see it as a kind of amplified wave when two similar ones meet together

3. for example

X = how many salty snacks i ate

Y = how much water i drank with them

the more varied X is, the more varied Y would be, we can guess

and vice versa

so var(X+Y) = var(X) + var(Y) + covar(X,Y)

#covar(X,Y) tells how much more would you consume X or Y by the consumption of Y or X

one more thing, what about var(X-Y)? would you think you still have to add covar(X,Y) to var(X)+var(Y)? or subtract? or need a whole new formula? please sleep on it(0 votes)

- I went ahead and solved this before watching the rest of the video.

My logic was slightly different and I ended up getting a Z-score of 0.8 instead of -0.8 which resulted in a slightly different value for the Probability (got 0.2119 instead of 0.212).

I'd like to know why my way of thinking about this problem is wrong.

For my Z-score I did 178-170 (X - mean) because my mean is the women's mean 170 and for all the women taller than the men they must have at least a height surpassing the men's mean 178. Then, I got a positive 8 then divide by 10 (sum of the 2 variances). Hence, I got a positive 0.8 Z-score.

I got the result mentioned above because when I drew out normal distribution on paper I drew out the men's then the women's on top of it because the -1SD of men (170) is the women's mean, instead of drawing out 3 different normal distribution graphs like Sal did.

When drawing this way, it led me into thinking that I needed to find the area under the curve of the women's distribution on the right from 178 towards positive infinity. Hence, I did (178-170)/10 to get a positive 0.8 Z-score. :(

But when Sal showed that D = M-W and to find the women taller than men P(D<0) this one makes sense to me as well. I find his way makes sense when he draws out 3 different graphs and my way makes sense when I superimpose 2 distribution graphs. So, I guess my mistake here was that I superimposed the graphs and for future solving of this kind of problem I should never superimpose to avoid being misled?(1 vote) - Why do we want to find the difference? (M - W) instead of find the sum of each independent variables? (M + W)(1 vote)
- Can someone help me understand why we subtract the random variables in order to find the answer to the question?(1 vote)
- Is there more than this, because my AP stats class already past this stuff in the 1st quarter?(0 votes)
- All the probability stuff is here:

https://www.khanacademy.org/math/statistics-probability(2 votes)

- Wouldn't -1E9999 work better or even -1E9999999999999999999999999

You know what I mean right?(0 votes)

## Video transcript

- [Instructor] Suppose
that men have a mean height of 178 centimeters with
a standard deviation of eight centimeters. Women have a mean height
of 170 centimeters with a standard deviation
of six centimeters. The male and female heights
are each normally distributed. We independently, randomly
select a man and a woman. What is the probability that the woman is taller than the man? So I encourage you to pause
this video and think through it, and I'll give you a hint. What if we were to define
the random variable M as equal to the height of
a randomly selected man? Height of random man. What if we define the random variable W to be equal to the height of a random woman? Woman. And we defined a third random variable in terms of these first two? So let me call this D, for difference. And it is equal to the
difference in height between a randomly selected man, and a randomly selected woman. So D, the random variable D is equal to the random variable M,
minus the random variable W. So the first two are clearly
normally distributed. They tell us that right over here. The male and female heights
are each normally distributed. And we also know, or you're about to know, that the difference of random variables that are each normally distributed is also going to be normally distributed. So given this, can you think about how to tackle this question? The probability that the
woman is taller than the man. Alright now let's work
through this together. And to help us visualize,
I'll draw the normal distribution curves for
these three random variables. So this first one is for the variable M, and so right here in the
middle, that is the mean of M. And we know that this is going to be equal to 178 centimeters. We'll assume everything is in centimeters. We also know that it
has a standard deviation of eight centimeters. So for example, if this is
one standard deviation above, this is one standard deviation below, this point right over here
would be eight centimeters more than 178, so that would be 186, and this would be eight
centimeters below that, so this would be 170 centimeters. So this is for the random variable M. Now let's think about
the random variable W. The random variable W, the mean of W they tell us is 170. And one standard deviation above the mean is going to be six
centimeters above the mean. The standard deviation
is six, six centimeters, so this would be minus six, is to go one standard
deviation below the mean. Now let's think about the
difference between the two. The random variable D. So let me think about this one a bit. The random variable D. The mean of D is going to be equal to the differences in the means
of these random variables. So it's going to be
equal to the mean of M, the mean of M, minus the mean of W. Minus the mean of W. Well we know both of these,
this is gonna be 178 minus 170, so let me write that down. This is equal to 178 centimeters minus 170 centimeters. Which is going to be equal to, I'll do it in this color, this is going to be equal
to eight centimeters. So this is eight right over here. Now what about the standard deviation? Assuming these two random
variables are independent, and they tell us that
we are independently, randomly selecting a man and a woman. The height of the man shouldn't affect the height of the woman, or vice versa. Assuming that these two
are independent variables, if you take the sum or
the difference of these, then the spread will increase. But you won't just add
the standard deviations. What you would actually
do is say the variance of the difference is going to be the sum of these two variances. So let me write that down. So I could write variance with VAR, or I could write it as the
standard deviation squared. So let me write that. The standard deviation of D,
of our difference, squared, which is the variance,
is going to be equal to the variance of our variable M, plus the variance of our variable W. Now this might be a little
bit counterintuitive. This might've made sense to you if this was plus right over here. But it doesn't matter if we
are adding or subtracting, and these are truly independent variables. Then regardless of whether
we're adding or subtracting, you would add the variances. And so we can figure this out. This is going to be equal
to the standard deviation of variable M is eight. So eight squared is going to be 64. And then we have six squared. This right over here is six. Six squared is going to be 36. You add these two together, this is going to be equal to 100. And so the variance of this
distribution right over here is going to be equal to 100. Well what's the standard
deviation of that distribution? Well it's going to be equal to the square root of the variance. So the square root of
100, which is equal to 10. So for example, one standard
deviation above the mean is going to be 18. One standard deviation below the mean is going to be equal to negative two. And so now using this distribution we can actually answer this question. What is the probability that the woman is taller than the man? Well we can rewrite
that question as saying, what is the probability that
the random variable D is, what conditions would it be? Pause the video and think about it. Well the situation's where the
woman is taller than the man, if the woman is taller than the man, then this is gonna be a negative value. Then D is gonna be less than zero. So what we really want to do is figure out the probability that D is less than zero. And so what we want to do if
we say zero is right over... If we say that zero is right
over here on our distribution, so that is D is equal to zero, we want to figure out,
well what is the area under the curve less than that? So we want to figure out this entire area. There's a couple of
ways you could do this. You could figure out the Z
score for D equaling zero, and that's pretty straightforward. You could just say, this Z is
equal to zero minus our mean of eight divided by our
standard deviation of 10. So it's negative eight over 10, which is equal to negative 8/10. So you could look up a Z table and say, what is the total area under the curve below Z is equal to negative 0.8? Another way you could do this is you could use a graphing calculator. I have a TI-84 here. Where you have a normal
cumulative distribution function. I'm gonna press second VARS, and that gets me to distribution. And so I have these various functions. I want normal cumulative
distribution function, so that is choice two. And then the lower bound. Well I want to go to negative infinity. Well calculators don't have
a negative infinity button, but you could put in a very, very, very, very negative number that for our purposes, is
equivalent to negative infinity. So we could say negative one
times 10 to the 99th power. And the way we do that is second, these two capital E's
are saying essentially, times 10 to the, and I'll say 99th power. So this is a very, very,
very negative number. The upper bound here, we
want to go delete this. The upper bound is going to be zero. We're finding the area
from negative infinity all the way to zero. The mean here, well we've
already figured that out. The mean is eight. And then the standard deviation here, we figured this out too,
this is equal to 10. And so when we pick this, we're gonna go back to
the main screen, enter. So this is we could've just typed this in directly on the main screen. This says look, we are looking
at a normal distribution. We want to find the cumulative
area between two bounds. In this case, it's from
negative infinity to zero. From negative infinity to zero, where the mean is eight, and
the standard deviation is 10. We press enter, and we
get approximately 0.212. Is approximately 0.212. Or we could say what is the probability that the woman is taller than the man? Well, 0.212, or approximately, there's a 21.2% chance of that happening. A little better than one in five.