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:8:59

Video transcript

let's learn a little bit about the law of large numbers which is on many levels one of the most intuitive laws in mathematics and in probability theory but because it's so applicable to so many things or it's often a misused law or sometimes a slightly misunderstood so so just to be a little bit formal and in our mathematics let me just define it for you first and then we'll talk a little bit about the intuition so let's say I have a random variable X right and we know its expected value or its population mean the law of large numbers just says that if we take a sample of n observations of our random variable and if we were to average all of those observations and let me define another another variable let's call that X sub n with a line on top of it that this is the mean of n observations of our random variable so it's literally this is my first observation so I you could kind of say I run the experiment once and I get this observation and I run it again I get that observation and I keep running it n times and then I divide by my number of observations so this is my sample mean this is the mean of all of the observations I've made the law of large numbers just tells us that my sample mean will approach my expected value of the random variable or you know I could also write it as my populate my sample mean will approach my population mean for n approaching infinity and I'll be a little informal with you know this what is approach or what is convergence mean but I think you have the general intuitive sense that if I take a large enough sample here that I'm going to end up getting the expected value of the population as a whole and I think to a lot of us that's you know kind of intuitive that if I do enough trials that over large samples that the trials would kind of give me the numbers that I would expect given the expected value and the probability all that but I think that it's often a little bit misunderstood and in terms of why that happens and before I go into that let me let me give you a particular example so the law of large numbers will just tell us that let's say I have a random variable X is equal to the number of heads after 100 tosses of a fair coin tosses or flips of a fair coin the law of large numbers just tells us well first of all we know what the expected value of this random variable is it's the number of tosses the number of trials times the probability of success of any trial so that's equal to 50 so a lot of large numbers just says if I were to take a a sample or if I were to average the sample of a bunch of these trials so you know I get I don't know my first time I run this trial I flip 100 coins or have 100 coins in a shoebox and I shake the shoebox and I count the number of heads and I get 55 so that would be X 1 then I shake the box again and I get 65 then I shake the box again and I get 45 and I do this n times and then I divide it by the number of times I did it the law of large numbers just tells us that this average the average of all of my observations is going to converge to 50 as n approaches infinity or 4 and approaching 50 sorry and approaching infinity and I want to talk a little bit about why this happens or intuitively why this is a lot of people kind of feel that like oh this means that if you know after a hundred trials that if I'm above the average that somehow the laws of probability are going to give me more heads or let our fewer heads to kind of make up the difference in it that's not quite what's going to happen and that's often called the gamblers fallacy let me let me differentiate and I'll use this example so let's say let me make a graph and I'll switch colors let's say that this is so let me make so on the this is n my x-axis is n this is the number of trials I take and my y-axis let me make that the sample mean and we know what the expected value is right we know the expected value of this random variable is it's 50 let me draw that here this is 50 so just going to the example I did so when n is equal to let me just apply it here so my first trial I got 55 and so that was my average right I only had one data point then after two trials let's see then I have 65 and so my average is going to be 65 plus 55 divided by 2 which is 60 so then my average went up a little bit then I had a 45 which will bring my average down a little bit right I won't plot a 45 here now I have to average all of these out what's 45 plus 65 well I could let me let me actually just get the number so you get the point so it's 55 plus 65 it's 120 plus 45 is 165 divided by 3 is 3 goes into 165 5 5 times 3 is 15 it's 53 right no no 15 55 55 so the average goes down back down to 55 and we can keep doing these trials right so you might say that the law of large numbers tells us ok after we've done three trials we've done 3 tiles and our average is there so a lot of people think that somehow the gods of probability we're going to make it more likely that we get fewer heads in the future that somehow the the next couple of trials are going to have to be down here in order to bring our average down and that's not necessarily the case going forward the probabilities are always the same the probabilities are always 50% that I'm going to get heads it's not like if I had a bunch of heads to start off with or more than I would have expected to start off with that all of a sudden things would be made up and I'd get more tails and that would that would be the the gamblers fallacy that if you have a long streak of heads or you have a disproportionate number of heads that at some point you're going to have you have a higher likelihood of having a disproportionate number of tails and that's not quite true what the law of large numbers tells us is that I you know it doesn't care let's say after you know some finite number of trials your average actually you know it's a low probability of this happening but let's say your average is actually up here is actually at 70 right like wow you know we really diverged a good bit from the expected value but with the law of large numbers says well I don't care how many trials this is we have an infinite number of trials left right and the expected value for that infinite number of trials are especially in type in this type of situation is going to be this so when you average a finite number that averages out to some high number and then an infinite number that's going to converge to this you're going to over time converge back to the expected value and that's just that was a very informal way of describing it but that's what the large large numbers tells you is that and it's an important thing it's not telling you that if you get a bunch of heads that somehow the probability of getting tails is going to increase to kind of make up for the heads what is telling you is is that over no matter what happened over a finite number of trials or what number what the average is over a finite number of trials you have an infinite number of trials left and if you do enough of them it's going to converge back to your expected value and this is an important thing to think about but this isn't used in practice every day with the lottery and with with casinos because they know that if you do a large large enough samples and we could even calculate you know if you do large enough samples what's the probability that things are you know deviate significantly but casinos and and the lottery everyday operate on this principle that if you take enough people sure in the short-term or with a few few samples a couple people might beat the house but over the long term the house is always going to win because of the parameters of the games that they're making you play anyway this is an important thing in probability and I think it's fairly intuitive although you know sometimes when you see it formally explained like this with the random variables and that's a little bit confusing all it's saying is is that as you take more and more samples the average of that sample the average of that sample is going to approximate the true average or actually the Loomer particular the mean of your sample is going to converge to the true mean of the population or to the expected value of the random variable anyway see in the next video