We now know what a probability of distribution is or they could be discrete probably distribution or continuous one and we learn about the probability density function. Now well study a couple of the more common ones. so let say I have a coin and it’s a fair coin and I'm going to flip it five times, flip it, flip five times and I'm going to define my random variable X, all the file.
Look at the capital X, it equals the number of heads. I get after five flips, after five flips. Maybe I flipped them all at one, maybe I have coins and I took them all once and I just count the heads or I can have one coin, and I can flip five times and see the number heads. It actually doesn’t matter but lets just; well let say I have five or one coin and I flip it five times. So just we have no ―. So this is my definition of my random variable as we know a random variable it’s a little different than the regular variable. It’s more of a function.
It assigns a number with an experiment and then this one is pretty easy. We just coin the number of heads we got after five flips and that’s our random variable X. lets think about a little bit of what are the different probabilities of getting different numbers here. So what is the probability, what is the probability that X, big capital X=0. So what's the probability that you get no heads after five flips?
Well, that’s essentially the same thing as the probability of getting all tails, right. This is a bit of a review of probability. You got to get all tails and what's the probability of each of this tails? What's ½? So it have to be ½×½×½×½×½, so it had to be 1/2 to the fifth power which is one to the fifth is 1/2 to the fifth is 32, fair enough. Now what's the probability and this will be; I'm going through all of the, you know, a little bit of a probability review. I just think it’s important just you get the intuition of what where going now and how you actually form a discrete probability distribution.
Now what's the probability, what's the probability that you get exactly one head? Well you could have, that could just be the first head right, to be heads then tails, tails, tails, tails, tails or it could be the second head. It could be probability of tails, heads, tails, tails, tails, and so forth that this one head that you get it could be in any of the five spots right. So, what's the probability of each of these situations?
Well, the probability that you get a head is 1/2 then the probability with the tails is 1/2x1/2x1/2x1/2, so the probability of each of this situations. Each of these situations is 1/32 just like the probability of this particular situation. In fact the probability of any particular order of heads and tails is going to be 1 out of 32. No there's actually 32 possible scenarios right. So the probability of this is 1 out of 32. The probability of this 1 out of 32 and there's five situations like this because the head this could be in any of the five spots.
So the probability that we have exactly one head is equal to 5x1/32=5/32, fair enough. Now its gets interesting, what is the probability of do each of this in a different color. What is the probability that my random variable is equal to two? So I flip the coin five times. What is the probability that I get exactly two heads? Now it becomes a little bit interesting. So what are all the situations I could have heads, heads, tails, tails, tails. I could have a head, tails, heads, tails, tails, if you think about it.
There’s this two heads and they can go in a bunch of different places and it starts to get a little bit confusing. You can't just think of it in a kind of scenario analysis like we did here. You can but it becomes a little bit confusing and you have to realize one thing. Each of these scenarios, there is 1 out of 32 probabilities, right. 1/2x1/2x1/2x1/2x1/2x1/2x1/2x1/2, so that’s the 1 out of 32 probability, right each of those and we have to think about it.
How many of these scenarios satisfy our condition? Two heads, so essentially we have; you could imagine, you know we have five flips and were going to choose two of them to be heads, right. So you could almost imagine like if you had all of the flips sitting around and we had two chairs and we said okay which ever flips sit in this chairs. They get to be the heads chair right or they have to be head flips and we don’t care at order of what order they sit in and I'm going some place with this.
So, just so you get hopefully a little intuition and you might want to watch them with the probability videos on this. When I talk about the binomial theorem and all of that― it is because I go into this― in a little bit more detail. But if you think about it, the binomial coefficient starts to make sense.
Okay I have five heads. I have five flips sorry, whose going to sit it. Which flip is going to be the first heads? Well there is five possibilities right. So let me do this in a different color. There are five possibilities for which of the positions or which of the flips is going to be the first head. Now how many possibilities are there for the second head? Well the first flip that we use, used up one the heads chairs right or sorry. The first heads chair, the first head spot was used up by one the flips.
Now, there are only four flips left. So, there is only 1 out of 4 flips that the second head could be and you saw that here. I pick the first one to be a heads here and then we said okay. One of these four also have to be head or I said okay this is the first head then either , this one, this one, this one or this one has to be heads. So there are only four possibilities.
So all I'm saying is the first time around. There are five; your five different possibilities for where the first heads could be and then the second time around you have four different possibilities. And they have to think about it. When we counted just like this we’re being dependent on order, right but we don’t care which flip is in which head.
We’re not saying that there's kind of you know, were not saying that this is heads one or this is a heads two. These are both heads. It doesn’t matter, we could have this being the, you know the head seat one. This could be head seat two or it could be the other way around. This is could be the second head spot and this is could be the first head spot and I'm saying that just because it’s important to realize the distribution of permutation and the combination. We don’t care about order. So there's actually two different ways that this can happen.
So we divide it by two and as you’ll see it’s actually two factorial ways that it can happen if this had three. We will do three factorial and I'll show you how that can happen. And so this will be equal to 5x4=20÷2=10. So there's 10 different combinations out of the 32 were you have exactly two heads. So 10x1 out of 32 equal to 10/32 which is equal to what, 5/16?
Now what is the problem? And actually let me write this in terms of binomial coefficient. This up here that number right there, if you think about it that’s the same thing as 5 factorial over. What's 5x4, five factorials is 5x4x3x2x1, so if I just want 5x4, what I can do is I divide five factorial divided by three factorial right. This is equal to 5x4x3x2x1 divided 3x2x1 and you just left with the 5x4.
So this is the same thing as that and then since we didn’t care about order. We wanted the two here and it actually turns out that its two factorial and I'll show you that in a little bit. It is two factorial times 1/32. This is the probability that our random variable that we have exactly two heads. Now what's the probability that we have exactly three heads? The probability that X=3 so they have the same logic.
The first head spot can be taken by one of the five flips then the second head spot could be taken by one of the four left remaining flips and in the third head spot could be taken by one of the three remaining flips. And then how many different ways can I arrange three flips? In general how many ways can you arrange three things and its 3 factorial, and you could work that out or you might want to watch the probability videos where I work that a little bit better.
But actually if you know, if you just take a, you know, the letters A, B, and C. there's six ways that you can arrange this right. You could have view this as the head spots and we don’t care about orders. It could be you know, A, C, B, C, A, B, it could be B, A, C, B, C, A and then what's the last one that I haven’t done. It is C, B, A, right?
There are six ways to arrange three distinct things. Were dividing by it because we don’t want to double count these six different ways because we viewing them all as the same thing. Not in this case but in the case of, we don’t care which flip is sitting in which head spot. So that’s why I got the 3 factorial and this is the same thing, 5x4x3. This is could be written as 5 factorial divided by 3 factorial and then this is divided by 3 factorial. This one is this one and so this is equal to I don’t know well that’s see 3 factorial is equal to 3x2x1.
The three is cancelled out. This becomes a two. This becomes a one. Once again 5x2 so it’s 10 and then its 10 and times, and there's each situation has 1 and 32 probability. So once again it’s equal to 5/16 and that’s interesting. The probability that you get three heads is the same as the probability that you get two heads and the reason that will. Well there's a lot of reasons why that’s the case but if you think about the probability of getting three heads is the same thing as the probability of getting two tails, right. And the probability of getting of two tails should be the same thing as the probability of getting two heads and so it’s nice that the numbers worked out that way. It’s nice that numbers worked out that way. All right, so were almost there. What’s the probability of getting, what's the probability that X=4?
Well we could use the same kind of formula now that we’ve using before. You know it could be 5x4x3x2 but that just 5x4x3x2 all the way, you know how many ways can you arrange four things. It is four factorial, 4 factorial is essentially this thing right here, right. 4x3x2x1, you know this is 4x3x2x1, so this cancels out. So it’s five and then each of the scenarios has 1 and 32 chance is equal to 5/32 seconds.
And once again, notice the probability of getting four heads is the same thing as the probability of getting exactly one head. And that make sense because four heads is the same thing as getting exactly one tail, right and oh where’s that one tail going to be showing up? Oh its just five different spots for it and each of the scenarios has a 1 and 32 possibility and in finally what's the probability that X=5? You get all five heads, well that’s going to be you know, its going to be heads, heads, heads, heads, heads.
Each of these are the 1/2 probability and multiply them and you get 1 out of 32 or another way to think about it. If you think about it, the 32 different ways that you could have heads and tails in this experiments. This is only one of those circumstances right. This was five of the circumstances. This was 10 of the circumstances. Anyway, we’ve done the work now, were ready to draw a probability distribution and I've actually I'm running out of time. Actually let me continue that in the next video maybe you have few in the mood maybe you draw it before you watch the next video. See you soon.