< Return to Video

Law of Large Numbers

  • 0:00 - 0:02
  • 0:02 - 0:08
    Let's learn a little bit about
    the law of large numbers, which
  • 0:08 - 0:12
    is on many levels, one of the
    most intuitive laws in
  • 0:12 - 0:14
    mathematics and in
    probability theory.
  • 0:14 - 0:19
    But because it's so applicable
    to so many things, it's often a
  • 0:19 - 0:22
    misused law or sometimes,
    slightly misunderstood.
  • 0:22 - 0:26
    So just to be a little bit
    formal in our mathematics, let
  • 0:26 - 0:29
    me just define it for you first
    and then we'll talk a little
  • 0:29 - 0:29
    bit about the intuition.
  • 0:29 - 0:34
    So let's say I have a
    random variable, X.
  • 0:34 - 0:39
    And we know its expected value
    or its population mean.
  • 0:39 - 0:42
    The law of large numbers just
    says that if we take a sample
  • 0:42 - 0:46
    of n observations of our random
    variable, and if we were
  • 0:46 - 0:49
    to average all of those
    observations-- and let me
  • 0:49 - 0:51
    define another variable.
  • 0:51 - 0:54
    Let's call that x sub n
    with a line on top of it.
  • 0:54 - 0:57
    This is the mean of n
    observations of our
  • 0:57 - 0:58
    random variable.
  • 0:58 - 1:01
    So it's literally this is
    my first observation.
  • 1:01 - 1:03
    So you can kind of say I run
    the experiment once and I get
  • 1:03 - 1:07
    this observation and I run it
    again, I get that observation.
  • 1:07 - 1:12
    And I keep running it n times
    and then I divide by my
  • 1:12 - 1:13
    number of observations.
  • 1:13 - 1:14
    So this is my sample mean.
  • 1:14 - 1:17
    This is the mean of all the
    observations I've made.
  • 1:17 - 1:23
    The law of large numbers just
    tells us that my sample mean
  • 1:23 - 1:28
    will approach my expected
    value of the random variable.
  • 1:28 - 1:33
    Or I could also write it as my
    sample mean will approach my
  • 1:33 - 1:40
    population mean for n
    approaching infinity.
  • 1:40 - 1:43
    And I'll be a little informal
    with what does approach or
  • 1:43 - 1:44
    what does convergence mean?
  • 1:44 - 1:46
    But I think you have the
    general intuitive sense that if
  • 1:46 - 1:51
    I take a large enough sample
    here that I'm going to end up
  • 1:51 - 1:54
    getting the expected value of
    the population as a whole.
  • 1:54 - 1:57
    And I think to a lot of us
    that's kind of intuitive.
  • 1:57 - 2:02
    That if I do enough trials that
    over large samples, the trials
  • 2:02 - 2:04
    would kind of give me the
    numbers that I would expect
  • 2:04 - 2:07
    given the expected value and
    the probability and all that.
  • 2:07 - 2:09
    But I think it's often a little
    bit misunderstood in terms
  • 2:09 - 2:11
    of why that happens.
  • 2:11 - 2:13
    And before I go into
    that let me give you
  • 2:13 - 2:15
    a particular example.
  • 2:15 - 2:17
    The law of large numbers will
    just tell us that-- let's say I
  • 2:17 - 2:25
    have a random variable-- X is
    equal to the number of heads
  • 2:25 - 2:31
    after 100 tosses of a fair
    coin-- tosses or flips
  • 2:31 - 2:33
    of a fair coin.
  • 2:33 - 2:36
  • 2:36 - 2:38
    First of all, we know what
    the expected value of
  • 2:38 - 2:40
    this random variable is.
  • 2:40 - 2:43
    It's the number of tosses,
    the number of trials times
  • 2:43 - 2:46
    the probabilities of
    success of any trial.
  • 2:46 - 2:49
    So that's equal to 50.
  • 2:49 - 2:53
    So the law of large numbers
    just says if I were to take a
  • 2:53 - 2:58
    sample or if I were to average
    the sample of a bunch of these
  • 2:58 - 3:03
    trials, so you know, I get-- my
    first time I run this trial I
  • 3:03 - 3:06
    flip 100 coins or have 100
    coins in a shoe box and I shake
  • 3:06 - 3:10
    the shoe box and I count the
    number of heads, and I get 55.
  • 3:10 - 3:12
    So that Would be X1.
  • 3:12 - 3:15
    Then I shake the box
    again and I get 65.
  • 3:15 - 3:18
    Then I shake the box
    again and I get 45.
  • 3:18 - 3:23
    And I do this n times and then
    I divide it by the number
  • 3:23 - 3:24
    of times I did it.
  • 3:24 - 3:27
    The law of large numbers just
    tells us that this the
  • 3:27 - 3:31
    average-- the average of all
    of my observations, is going
  • 3:31 - 3:39
    to converge to 50 as n
    approaches infinity.
  • 3:39 - 3:41
    Or for n approaching 50.
  • 3:41 - 3:43
    I'm sorry, n
    approaching infinity.
  • 3:43 - 3:45
    And I want to talk a little
    bit about why this happens
  • 3:45 - 3:47
    or intuitively why this is.
  • 3:47 - 3:51
    A lot of people kind of feel
    that oh, this means that if
  • 3:51 - 3:55
    after 100 trials that if I'm
    above the average that somehow
  • 3:55 - 3:58
    the laws of probability are
    going to give me more heads
  • 3:58 - 4:00
    or fewer heads to kind of
    make up the difference.
  • 4:00 - 4:02
    That's not quite what's
    going to happen.
  • 4:02 - 4:04
    That's often called the
    gambler's fallacy.
  • 4:04 - 4:05
    Let me differentiate.
  • 4:05 - 4:07
    And I'll use this example.
  • 4:07 - 4:08
    So let's say-- let
    me make a graph.
  • 4:08 - 4:09
    And I'll switch colors.
  • 4:09 - 4:23
  • 4:23 - 4:25
    This is n, my x-axis is n.
  • 4:25 - 4:28
    This is the number
    of trials I take.
  • 4:28 - 4:33
    And my y-axis, let me make
    that the sample mean.
  • 4:33 - 4:36
    And we know what the expected
    value is, we know the expected
  • 4:36 - 4:39
    value of this random
    variable is 50.
  • 4:39 - 4:40
    Let me draw that here.
  • 4:40 - 4:43
  • 4:43 - 4:43
    This is 50.
  • 4:43 - 4:47
  • 4:47 - 4:50
    So just going to
    the example I did.
  • 4:50 - 4:54
    So when n is equal to--
    let me just [INAUDIBLE]
  • 4:54 - 4:55
    here.
  • 4:55 - 4:59
    So my first trial I got 55
    and so that was my average.
  • 4:59 - 5:01
    I only had one data point.
  • 5:01 - 5:05
    Then after two trials,
    let's see, then I have 65.
  • 5:05 - 5:09
    And so my average is going to
    be 65 plus 55 divided by 2.
  • 5:09 - 5:10
    which is 60.
  • 5:10 - 5:13
    So then my average
    went up a little bit.
  • 5:13 - 5:15
    Then I had a 45, which
    will bring my average
  • 5:15 - 5:17
    down a little bit.
  • 5:17 - 5:18
    I won't plot a 45 here.
  • 5:18 - 5:20
    Now I have to average
    all of these out.
  • 5:20 - 5:22
    What's 45 plus 65?
  • 5:22 - 5:24
    Let me actually just
    get the number just
  • 5:24 - 5:25
    so you get the point.
  • 5:25 - 5:29
    So it's 55 plus 65.
  • 5:29 - 5:33
    It's 120 plus 45 is 165.
  • 5:33 - 5:36
    Divided by 3.
  • 5:36 - 5:40
    3 goes into 165 5--
    5 times 3 is 15.
  • 5:40 - 5:42
    It's 53.
  • 5:42 - 5:44
    No, no, no.
  • 5:44 - 5:45
    55.
  • 5:45 - 5:47
    So the average goes
    down back down to 55.
  • 5:47 - 5:49
    And we could keep
    doing these trials.
  • 5:49 - 5:52
    So you might say that the law
    of large numbers tell this,
  • 5:52 - 5:57
    OK, after we've done 3 trials
    and our average is there.
  • 5:57 - 6:00
    So a lot of people think that
    somehow the gods of probability
  • 6:00 - 6:02
    are going to make it more
    likely that we get fewer
  • 6:02 - 6:03
    heads in the future.
  • 6:03 - 6:06
    That somehow the next couple of
    trials are going to have to
  • 6:06 - 6:09
    be down here in order to
    bring our average down.
  • 6:09 - 6:11
    And that's not
    necessarily the case.
  • 6:11 - 6:13
    Going forward the probabilities
    are always the same.
  • 6:13 - 6:15
    The probabilities are
    always 50% that I'm
  • 6:15 - 6:16
    going to get heads.
  • 6:16 - 6:20
    It's not like if I had a bunch
    of heads to start off with or
  • 6:20 - 6:22
    more than I would have expected
    to start off with, that all of
  • 6:22 - 6:25
    a sudden things would be made
    up and I would get more tails.
  • 6:25 - 6:28
    That would the
    gambler's fallacy.
  • 6:28 - 6:30
    That if you have a long streak
    of heads or you have a
  • 6:30 - 6:32
    disproportionate number of
    heads, that at some point
  • 6:32 - 6:35
    you're going to have-- you have
    a higher likelihood of having a
  • 6:35 - 6:37
    disproportionate
    number of tails.
  • 6:37 - 6:38
    And that's not quite true.
  • 6:38 - 6:41
    What the law of large numbers
    tells us is that it doesn't
  • 6:41 - 6:46
    care-- let's say after some
    finite number of trials your
  • 6:46 - 6:48
    average actually-- it's a low
    probability of this happening,
  • 6:48 - 6:50
    but let's say your average
    is actually up here.
  • 6:50 - 6:52
    Is actually at 70.
  • 6:52 - 6:56
    You're like, wow, we really
    diverged a good bit from
  • 6:56 - 6:57
    the expected value.
  • 6:57 - 6:58
    But what the law of large
    numbers says, well, I don't
  • 6:58 - 7:00
    care how many trials this is.
  • 7:00 - 7:04
    We have an infinite
    number of trials left.
  • 7:04 - 7:07
    And the expected value for that
    infinite number of trials,
  • 7:07 - 7:12
    especially in this type of
    situation is going to be this.
  • 7:12 - 7:16
    So when you average a finite
    number that averages out to
  • 7:16 - 7:18
    some high number, and then an
    infinite number that's going to
  • 7:18 - 7:23
    converge to this, you're going
    to over time, converge back
  • 7:23 - 7:24
    to the expected value.
  • 7:24 - 7:27
    And that was a very informal
    way of describing it, but
  • 7:27 - 7:30
    that's what the law or
    large numbers tells you.
  • 7:30 - 7:31
    And it's an important thing.
  • 7:31 - 7:34
    It's not telling you that if
    you get a bunch of heads that
  • 7:34 - 7:36
    somehow the probability of
    getting tails is going
  • 7:36 - 7:38
    to increase to kind of
    make up for the heads.
  • 7:38 - 7:42
    What it's telling you is, is
    that no matter what happened
  • 7:42 - 7:45
    over a finite number of trials,
    no matter what the average is
  • 7:45 - 7:47
    over a finite number of
    trials, you have an infinite
  • 7:47 - 7:48
    number of trials left.
  • 7:48 - 7:52
    And if you do enough of them
    it's going to converge back
  • 7:52 - 7:53
    to your expected value.
  • 7:53 - 7:54
    And this is an important
    thing to think about.
  • 7:54 - 7:58
    But this isn't used in practice
    every day with the lottery and
  • 7:58 - 8:02
    with casinos because they know
    that if you do large enough
  • 8:02 - 8:05
    samples-- and we could even
    calculate-- if you do large
  • 8:05 - 8:08
    enough samples, what's the
    probability that things
  • 8:08 - 8:10
    deviate significantly?
  • 8:10 - 8:13
    But casinos and the lottery
    every day operate on this
  • 8:13 - 8:16
    principle that if you take
    enough people-- sure, in the
  • 8:16 - 8:18
    short-term or with a few
    samples, a couple people
  • 8:18 - 8:20
    might beat the house.
  • 8:20 - 8:22
    But over the long-term the
    house is always going to win
  • 8:22 - 8:24
    because of the parameters of
    the games that they're
  • 8:24 - 8:25
    making you play.
  • 8:25 - 8:28
    Anyway, this is an important
    thing in probability and I
  • 8:28 - 8:30
    think it's fairly intuitive.
  • 8:30 - 8:33
    Although, sometimes when you
    see it formally explained like
  • 8:33 - 8:34
    this with the random variables
    and that it's a little
  • 8:34 - 8:35
    bit confusing.
  • 8:35 - 8:40
    All it's saying is that as you
    take more and more samples, the
  • 8:40 - 8:45
    average of that sample is going
    to approximate the
  • 8:45 - 8:46
    true average.
  • 8:46 - 8:47
    Or I should be a little
    bit more particular.
  • 8:47 - 8:52
    The mean of your sample is
    going to converge to the true
  • 8:52 - 8:55
    mean of the population or to
    the expected value of
  • 8:55 - 8:56
    the random variable.
  • 8:56 - 8:59
    Anyway, see you in
    the next video.
Title:
Law of Large Numbers
Description:

more » « less
Video Language:
English
Team:
Khan Academy
Duration:
09:00

English subtitles

Revisions Compare revisions