Variance of a binomial variable | Random variables | AP Statistics | Khan Academy
What we're going to do in this video is continue our journey trying to understand what the expected value and what the variance of a binomial variable is going to be, or what the expected value or the variance of a binomial distribution is going to be, which is just the distribution of a binomial variable.
So, like in the last video, I have this binomial variable x that's defined in a very general sense. It's the number of successes from n trials, so it's a finite number of trials where the probability of success is equal to p. The probability is constant across the trials for each of these independent trials. So, the probability of success in one trial is not dependent on what happened in the other trials.
We also talked in that previous video where we talked about the expected value of this binomial variable. We said, "Hey, it could be viewed as the sum of n of what you could really consider to be a Bernoulli variable." Here, this variable, this random variable y, the probability that's equal to one—you could view that as a success—is equal to p. The probability that it's a failure, that y is equal to zero, is one minus p.
So, you could view y, the outcome of y, is really the—whether y is one or zero is really whether we had a success or not in each of these trials. If you add up n y's, then you are going to get x, and we use that information to figure out what the expected value of x is going to be because the expected value of y is pretty straightforward to directly compute. The expected value of y is just probability-weighted outcomes, so it's p times 1 plus 1 minus p times 0. This whole term is going to be 0, and so the expected value of y is really just p.
And so if you said the expected value of x, well, let's just write it over here—this is all review—we could say that the expected value of x is just going to be equal to—we know from our expected value properties that's going to be equal to the sum of the expected values of these n y's, or you could say it is n times the expected value of y. The expected value of y is p, so this is going to be equal to n times p.
Now we're going to do the same idea to figure out what the variance of x is going to be equal to because we know from our variance properties that you can't do this with standard deviation, but you could do it with variance. Then once you figure out the variance, you just take the square root for the standard deviation. The variance of x is similarly going to be the sum of the variances of these n y's, so it's going to be n times the variance of y.
So this all boils down to what the variance of y is going to be equal to. So let me scroll over a little bit, get a little bit of more real estate, and I will figure that out right over here.
All right, so we want to figure out the variance of y. So, the variance of y is going to be equal to what? Well, here it's going to be the probability squared distances from the expected value. We have a probability of p; where is our squared distance from the expected value? Well, we're going to get a 1 with the probability of p. So in that case, our distance from the mean or from the expected value—we're at one. The expected value we already know is equal to p, so that's that for that possible outcome—the squared distance times its probability weight.
Then we have—actually, let me scroll over—well, I'll just do it right over here. Plus, we have a probability of one minus p for the other possible outcome. So in that outcome, we are at—and the difference between 0 and our expected value—well, that's just going to be 0 minus p and once again we are going to square that distance. So this is the expression for the variance of y, and we can simplify it a little bit.
So this is all going to be equal to—let me just—p times 1 minus p squared, and then this is just going to be p squared times 1 minus p plus p squared times 1 minus p. Let's see, we can factor out a p times 1 minus p. So what is that going to be left with? If we factor out a p times 1 minus p here, we're just going to be left with a 1 minus p. If we factor out a p times 1 minus p here, we're just going to have a plus p.
These two cancel out; this whole thing is just a 1. So, you're left with p times 1 minus p, which is indeed the variance for a binomial variable. We actually proved that in other videos; I guess it doesn't hurt to see it again, but there you have it.
We know what the variance of y is; it is p times 1 minus p, and the variance of x is just n times the variance of y. So there we go—we deserve a little bit of a drum roll. The variance of x is equal to n times p times 1 minus p.
So if we were to take the concrete example of the last video, where if I were to take 10 free throws—so each trial is a shot, is a free throw. If I were to take 10 free throws and my probability of success is 0.3, I have a 30 free throw percentage. The variance that I would expect to see—so in that case, the variance, if x is the number of free throws I make after these 10 shots, my variance will be 10 times 0.3, 0.3 times 1 minus 0.3, so 0.7.
That would be what this right over here; so this would be equal to 10 times 0.3 times 0.7, times 0.21. So my variance in this situation is going to be equal to 2.1, is equal to 2.1. And if I wanted to figure out the standard deviation of this right over here, I would just take the square root of this.
So if you want the standard deviation, just take the square root of this expression right over here.