Random variables and probability distributions
Expected Value: E(X) Expected value of a random variable
⇐ Use this menu to view and help create subtitles for this video in many different languages.
You'll probably want to hide YouTube's captions if using these subtitles.
- When we first started talking about central tendencies and
- how we measure average, we talked about the arithmetic
- mean and there you just added up the numbers and you
- divided by the number of numbers there were.
- So let's say our population of numbers is-- we have a 3.
- Let's say we have three 3's, a 4, and a 5.
- That's our population.
- And if we wanted the population mean here we were just
- add all the numbers up.
- We'd say 3 plus 3 plus 3 plus 4 plus 5.
- And then we would divide that sum by the number
- of numbers we have.
- We would divide that by 5.
- And we would come--let's see.
- What would this be?
- This would be 9 plus 9; it'd be 18/5.
- That would be 18/5, which would be what?
- 3 and 3/5, which is 3.6.
- It's a population mean for this population of numbers.
- If we just rearranged the math here a little bit we could view
- it a slightly different way.
- How many 3's do we have?
- We have three 3's, so we could view this as 3 times 3.
- How many 4's do we have?
- We have one 4, so it's plus 1 times 4.
- Plus 1 time 5.
- All of that divided by 5.
- And then what we could do is, this is the same thing.
- And I'm just doing a little bit of basic really,
- number manipulation here.
- This is the same thing as 1/5 times 3 times 3 plus
- 1 times 4 plus 1 times 5.
- And if we distribute this 1/5 this is equal to what?
- 3/5 times 3 plus 1/5 times 1.
- So it's plus 1/5 times 4 plus 1/5 times 5.
- And this we can see in a bunch of different ways.
- Let me express these as decimals.
- So 3/5.
- So it's 0.6 times 3 plus 0.2 times 4 plus 0.2 times 5.
- Or we could express these decimals as percentage.
- We could say 60% times 3, plus 20%-- sorry, 20% times 4.
- Plus 20% times 5.
- This is identical to adding up the numbers and then dividing
- by the total number of numbers there are.
- But this is interesting because here we had to know how many
- total numbers there are.
- We have to say, OK, we added up 5 numbers, we divided by 5.
- All I did is I played around with the
- arithmetic a little bit.
- And I got to this expression.
- But this expression's more interesting, or at least
- it's-- well, it's different.
- It's not necessarily more interesting.
- I don't want to make any value judgment about it.
- But here I don't know how many numbers there are.
- I'm just telling you about the frequency of the numbers.
- I'm telling you that 60% of the numbers are 3, 20% of
- the numbers are 4, and then 20% of the numbers are 5.
- And then if I were to calculate this out I would get
- 60% times 3 is 1.8.
- Plus 20% times 4 is 0.8.
- Plus 20% times 5 is-- let's see.
- 20% plus 1, which would be equal to 2.6, plus
- 1 is equal to 3.6.
- So we would get the exact same number, but what's interesting
- here is that this tells you just the frequencies-- really
- the relative frequencies of the 3's, the 4's, and the 5's.
- What percentage of this population is 3's?
- 60%.
- What percentage is 4's?
- 20%.
- And what population is 5's?
- And I'm doing that because we just talked about random
- variables and all of that.
- In the beginning we started our statistics discussion about
- populations and samples.
- But if you think about it, every time you do one of your
- experiments and you get a new value for a random variable--
- let's do our classic example.
- We have our random variable, x, is equal to-- I don't know--
- it's equal to the number of heads after 6 tosses
- of a fair coin.
- So that's our random variable.
- Hopefully now, we can kind of connect what we thought about
- in terms of just arithmetic mean and central tendency and
- population versus sample, and then connect that to the
- notion of a random variable.
- So when we first started talking about statistics we
- said, OK, you have this notion of a population.
- And that you would sample the population.
- And we gave a couple of examples.
- You know, the most common one is you wanted up predict
- the outcome of a presidential election.
- The population is everyone who's going to vote
- in the election.
- You can't survey all 50 million people or whatever's going
- to vote for the election.
- So what you do is you survey a random sample of that
- population and then you can calculate statistics on that
- sample that hopefully can estimate the population
- as a whole.
- But what happens if the population is not finite?
- And just to go back, if the population is finite you can
- calculate things like the population mean.
- We learned the population mean was that mu letter.
- And that was you just literally take up all of the items in the
- population, add them together, and you divide by the
- number of items there are.
- That's what we did up here.
- If this was a whole population of numbers, we've figured
- out that this was mu.
- If this was a sample from a population then this would
- be the sample mean, but we learned all about that.
- But that's not what I want to get at now.
- But what happens if this population is infinite?
- If it's infinite and you're like, oh, Sal, that
- doesn't make any sense.
- But if you think about it, well, a random variable really
- is-- you can kind of view it as each instance of a
- random variable.
- Or every time you performed the experiment you're taking
- out an instance of an infinite population.
- You can perform this experiment an infinite number of times.
- You can just keep doing it.
- It's not like, after doing it a thousand times you're like, oh,
- you can't toss a coin six times anymore and count the
- number of heads.
- You can perform this indefinitely.
- So every specific result from a random variable-- and those are
- usually lowercase results, lowercase x1 or x2 or x3.
- These are just specific instances of a random variable.
- You can view these as samples from an infinite population.
- So I'll try to draw an infinite population;
- it's kind of harder.
- Maybe I'll draw arrows that go off in every direction.
- This population never ends.
- You can keep performing the experiment and keep getting
- samples, but you're sample is usually finite.
- You know, let's say we performed this experiment.
- We toss a fair coin six times and we do that experiment--
- I don't know-- we do it a hundred times.
- So then we would have a hundred samples, x2 and it would
- go all the way to x100.
- And the reason why I'm doing this connection is one, to make
- you see the connection between the random variable and the
- probability, and the statistics that we talked about earlier.
- And in this video, I'm going to introduce you to the concept of
- the expected value of a random variable.
- And it's nothing else.
- So the expected value of a random variable, the expected
- value of a random variable is the exact same thing as
- the population mean.
- In fact, sometimes it's called a population mean.
- But what makes it interesting is in this situation, you
- have an infinite population.
- So you can't just add up all the numbers and divide by the
- number of numbers you have because you have an infinite
- number of numbers.
- But what you can do is if you said wow, I know the
- frequency of the numbers.
- I know that 3 shows up 60% of the time, 4 shows up
- 20% of the time, 5 shows up 20% of the time.
- Then, even if you have an infinite number of numbers,
- you can actually still calculate a mean.
- And that's how you do it for an expected value
- of a random variable.
- So how do you figure out the frequencies that
- numbers show up?
- Well, you can look at the probability distribution,
- the discreet probability distribution.
- So in that example that we did last time, I forgot the exact
- numbers, but actually let me just take what we
- did-- our Excel out.
- Let me just quickly, I want to make n 6 trials, probability
- of heads, tails-- OK, 0.5.
- And then I need to change what this chart-- just
- give me one second.
- Change what the inputs of this chart are.
- I'm off the screen right now.
- OK, there you go.
- So this is the probability distribution for what
- I just described.
- I have a fair toss of a coin and I want to know how many
- heads I have after 6 tosses.
- So you can perform this experiment a bunch of times,
- but this tells you the frequency, the frequency
- of that random variables.
- So when you perform that experiment-- let's see,
- whatever this is-- 0.09% of the time.
- No, actually, 9% of the time you're going to
- get exactly 1 head.
- 23% of the time you're going to get 2 heads.
- 31% of the time you're going to get 3 heads.
- 23% of the time you're going to get 4 heads.
- And then, you know 9% of the time you're going
- to get 5 heads.
- And then 2% of the time you're going to get 6 heads.
- So if you have that information you can then actually figure
- out the population mean for this population that's
- described by this probability distribution, or the
- expected value.
- And let's do that right here.
- I'll put this over to the side.
- So I'm looking at that chart I just did while I do this.
- We just looked at the probability distribution for
- this random variable, the number of heads after 6
- tosses of a fair coin.
- So the expected value of our random variable is going
- to be each outcome.
- So the first outcome is that we had 0 heads times the
- frequency that 0 shows up.
- So we figured out before that the frequency-- now, it's a
- little inexact because I don't have-- actually, I have
- the exact numbers.
- 0 will show up in our random variable 0.01563% of the time.
- So let me write that.
- So we're going to say, well, this happens and I can
- write it as a percentage 1.563% of the time.
- Plus 1 happens 9.375% of the time.
- And then plus 2 happens 23.438% of the time.
- Plus 3 happens-- let's see, it says 31.25% of the time.
- Almost there.
- 4, I get 4 heads out of 6 tosses 23% percent of the time.
- So times 23.438%.
- I get 5 heads after 6 tosses 9.375% of the time.
- And finally, I get all heads let's see-- no, I get all
- heads 1.563% of the time.
- And that makes sense again because all heads should be
- just as likely as all tails.
- All tails is the same thing is no heads.
- So what we did here is exactly what we did up here.
- We took the relative frequency of each of the numbers in the
- population and we multiply that outcome times its relative
- frequency, and we're adding it up.
- But this is the exact same thing mathematically
- as we did up here.
- But what's useful now is we can apply the same principles, but
- we're finding the arithmetic mean of an infinite population,
- or the expected value of a random variable, which is the
- same thing as the arithmetic mean of the population of
- this random variable.
- So this value would be equal to-- actually, let me just
- use Excel to calculate it.
- So the expected value of getting-- the number of heads
- you get after 6 tosses.
- So this is 0 times its frequency, and then I'm going
- to add them all up and then just will just do that
- same thing in all of it.
- So this says this will be 1 times its frequency, 2 times
- its frequency, and then if I were to take the sum of all of
- them-- equals sum of all of these-- I get exactly 3.
- And that's actually kind of an expected outcome, right?
- I shouldn't use the word expected too much.
- That the central tendency or you could say, the population
- mean, of this random variable, or you could say the expected
- value of this random variable is exactly 3.
- And in this example it turned out that 3 is also in kind of
- the colloquial sense, it's the most expected value.
- It's the most probable value.
- But we'll see in the future that the expected value
- doesn't have to be the most probable value.
- You could have a very high probability of having no heads
- and a very high probability of having 6 heads.
- And then you'd still have an expected value of 3, even if
- 6 or 0 were more probable.
- And I'll show you more examples of that.
- But the purpose of this video is to really show you that the
- expected value calculation is the same thing as the
- population mean calculation, but we do it this way because
- you can't add up an infinite number of data points and
- divide by an infinite number.
- Instead you want to know the frequencies of each of the
- outcomes and then you just add up all the outcomes weighted
- by their frequencies.
- But that's no different than what you did up there.
- And I really want to hit that point home because sometimes in
- probability books they'll just give you a formula-- oh, the
- expected value of a probability distribution is each of the
- outcomes times their frequency.
- But I want to show you that that is the same thing
- as the population mean.
- Anyway, see you in the next video.
Be specific, and indicate a time in the video:
At 5:31, how is the moon large enough to block the sun? Isn't the sun way larger?
|
Have something that's not a question about this content? |
This discussion area is not meant for answering homework questions.
Discuss the site
For general discussions about Khan Academy, visit our Reddit discussion page.
Flag inappropriate posts
Here are posts to avoid making. If you do encounter them, flag them for attention from our Guardians.
abuse
- disrespectful or offensive
- an advertisement
not helpful
- low quality
- not about the video topic
- soliciting votes or seeking badges
- a homework question
- a duplicate answer
- repeatedly making the same post
wrong category
- a tip or feedback in Questions
- a question in Tips & Feedback
- an answer that should be its own question
about the site
Share a tip
Suggest a fix
Have something that's not a tip or feedback about this content?
This discussion area is not meant for answering homework questions.