If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains ***.kastatic.org** and ***.kasandbox.org** are unblocked.

Main content

Current time:0:00Total duration:6:59

in the last video we figured out the mean variance and standard deviation for a Bernoulli distribution with specific numbers what I want to do in this video is to generalize it to figure out really the formulas for the mean and the variance of a Bernoulli distribution if we don't have the actual numbers if we just know that the probability of success is P and the probability of failure is 1 minus P so let's look at the let's look at this let's look at a population let's look at a population where the probability of success I will define success as 1 as having a probability of P of having a probability of P and the probability of failure the probability of failure has is 1 minus P whatever this might be 1 minus P and obviously if you add these two up if you view them as percentages these are going to add up to 100% or if you add up these two values we're going to add to 1 and that needs to be the case because every a these are the only two possibilities that can occur if this is if this is 60% chance of success there should be a 40% chance of failure 70% chance of success 30% chance of failure now with this definition of this and this is the most general this is the most general definition of a Bernoulli distribution of a Bernoulli distribution it's really exactly what we did in the last video I now want to calculate the expected value which is the same thing as the mean of this distribution and I also want to calculate I also want to calculate the variance which is the same thing as the expected squared distance of a value from the mean so let's do that so what is what is the mean over here what is going to be the mean well that's just the probability weighted sum of the values that this can take on so there is a 1 minus P probability there is a 1 minus P probability that we get failure that we get zero so there's 1 1 minus P probability of getting is 0 of getting 0 2 times you and then there is a P probability a P probability of getting one plus P times one plus P times one well this is pretty easy to calculate zero times anything is zero so that cancels out and then P times one is just going to be P is just going to be P so pretty straight forward the mean the expected value of this distribution is P and P might be you know here or something so it's once again it's a value that you cannot actually take on in this distribution which is interesting but it is the expected value now what is going to be the variance what is the variance of this distribution the variance remember that is the weighted sum of the squared distances from the mean now what's the probability that we get a 0 we already figure that out there's 1 minus P probability that we get a 0 so that is the probability part and what is the squared distance from 0 to our mean well the squared distance from 0 to our me let me write it over here it's going to be 0 that's the value we're taking on let me do that in blue since I already wrote 0 and 0 minus our mean minus our - let me do this in a new color - our mean that looks that's too similar to that orange let me do the mean and white zero minus our mean which is P which is P plus the probability that we get a 1 which is just P plus the probability we get a 1 just P and this is this is the squared distance let me be very careful it's the probability weighted sum of the squared distances from the mean now what's the distance now we got a 1 and what's the discrete one on the mean it's 1 minus our mean which is going to be which is going to be P over here and we're going to want to square this we want to square this as well this right here is going to be the variance now let's actually work this out so this is going to be equal to 1 minus P now 0 minus P is going to be negative P if you square it you're going to get P squared so it's going to be P squared then plus plus P times what's 1 minus P squared 1 minus P squared is going to be 1 squared it's going to be 1 squared which is just 1 minus 2 times the product of this so it's going to be minus 2p right over here minus 2p and then plus negative P squared so plus P plus P squared just like that and now let's multiply let's multiply everything out let's multiply everything out this is going to be this term right over here it's going to be P squared minus P to the third and then this term over here this whole thing over here is going to be plus P times 1 is P P times negative 2 P is negative 2 P squared and then P times P squared is P to the third now we can simplify these P to the third cancels that with P to the third and then we have P squared minus 2 P squared so this right here becomes you have this P right over here so this is equal to P and then when you add P squared to negative two P squared you're left with negative P squared so net minus P squared and if you want to factor a P out of this this is going to be equal to P times if you take P divided by P you get a 1 P squared divided by P is P so P times 1 minus P which is a pretty neat clean formula so our variance is P times 1 minus P and if we want to take it to the next level if we want to take it to the next level and figure out the standard deviation the standard deviation is just the square root is just the square root of the variance which is equal to the square root of P x times 1 minus P and we can even verify that this actually works for the example that we did up here our mean is P the probability of success we see that indeed was it was 0.6 and we know that our variance is essentially the probability of success times the probability of failure that's our variance right over there probability of success in this example was 0.4 or probability of success was six probability of failure is 0.4 you multiply the two you get point two four which is exactly what we got in the last example and if you take its square root for the standard deviation which is what we do right here it's 0.49 so hopefully you found that helpful and we're going to you were going to build on this later on in some of our inferential statistics