< Return to Video

Bernoulli Distribution Mean and Variance Formulas

  • 0:00 - 0:01
  • 0:01 - 0:04
    In the last video we figured
    out the mean, variance and
  • 0:04 - 0:06
    standard deviation for our
    Bernoulli Distribution with
  • 0:06 - 0:07
    specific numbers.
  • 0:07 - 0:10
    What I want to do in this video
    is to generalize it.
  • 0:10 - 0:13
    To figure out really the
    formulas for the mean and the
  • 0:13 - 0:16
    variance of a Bernoulli
    Distribution if we don't have
  • 0:16 - 0:17
    the actual numbers.
  • 0:17 - 0:21
    If we just know that the
    probability of success is p
  • 0:21 - 0:24
    and the probability a failure
    is 1 minus p.
  • 0:24 - 0:32
    So let's look at this, let's
    look at a population where the
  • 0:32 - 0:37
    probability of success-- we'll
    define success as 1-- as
  • 0:37 - 0:43
    having a probability of p, and
    the probability of failure,
  • 0:43 - 0:48
    the probability of failure
    is 1 minus p.
  • 0:48 - 0:50
    Whatever this might be.
  • 0:50 - 0:53
    And obviously, if you add these
    two up, if you view them
  • 0:53 - 0:55
    as percentages, these are
    going to add up to 100%.
  • 0:55 - 0:57
    Or if you add up these
    two values, they are
  • 0:57 - 0:58
    going to add to 1.
  • 0:58 - 1:03
    And that needs to be the case
    because these are the only two
  • 1:03 - 1:05
    possibilities that can occur.
  • 1:05 - 1:09
    If this is 60% chance of success
    there has to be a 40%
  • 1:09 - 1:10
    chance of failure.
  • 1:10 - 1:14
    70% chance of success, 30%
    chance of failure.
  • 1:14 - 1:17
    Now with this definition of
    this-- and this is the most
  • 1:17 - 1:21
    general definition of a
    Bernoulli Distribution.
  • 1:21 - 1:24
  • 1:24 - 1:27
    It's really exactly what we did
    in the last video, I now
  • 1:27 - 1:29
    want to calculate the expected
    value, which is the same thing
  • 1:29 - 1:32
    as the mean of this
    distribution, and I also want
  • 1:32 - 1:36
    to calculate the variance, which
    is the same thing as the
  • 1:36 - 1:41
    expected squared distance of
    a value from the mean.
  • 1:41 - 1:43
    So let's do that.
  • 1:43 - 1:47
    So what is the mean over here?
  • 1:47 - 1:48
    What is going to be the mean?
  • 1:48 - 1:51
    Well that's just the probability
    weighted sum of
  • 1:51 - 1:53
    the values that this
    could take on.
  • 1:53 - 2:01
    So there is a 1 minus p
    probability that we get
  • 2:01 - 2:03
    failure, that we get 0.
  • 2:03 - 2:08
    So there's 1 minus
    p probability of
  • 2:08 - 2:12
    getting 0, so times 0.
  • 2:12 - 2:17
    And then there is a p
    probability of getting 1,
  • 2:17 - 2:22
    plus p times 1.
  • 2:22 - 2:23
    Well this is pretty
    easy to calculate.
  • 2:23 - 2:25
    0 times anything is 0.
  • 2:25 - 2:27
    So that cancels out.
  • 2:27 - 2:30
    And then p times 1 is
    just going to be p.
  • 2:30 - 2:32
  • 2:32 - 2:33
    So pretty straightforward.
  • 2:33 - 2:38
    The mean, the expected value
    of this distribution, is p.
  • 2:38 - 2:40
    And p might be here
    or something.
  • 2:40 - 2:43
    So once again it's a value that
    you cannot actually take
  • 2:43 - 2:46
    on in this distribution,
    which is interesting.
  • 2:46 - 2:48
    But it is the expected value.
  • 2:48 - 2:51
    Now what is going to
    be the variance?
  • 2:51 - 2:55
    What is the variance of
    this distribution?
  • 2:55 - 2:59
    Remember, that is the weighted
    sum of the squared distances
  • 2:59 - 3:00
    from the mean.
  • 3:00 - 3:03
    Now what's the probability
    that we get a 0?
  • 3:03 - 3:04
    We already figured that out.
  • 3:04 - 3:07
    There's a 1 minus p probability
    that we get a 0.
  • 3:07 - 3:09
    So that is the probability
    part.
  • 3:09 - 3:13
    And what is the squared distance
    from 0 to our mean?
  • 3:13 - 3:16
    Well the squared distance from
    0 to our mean-- let me write
  • 3:16 - 3:19
    it over here-- it's going to be
    0, that's the value we're
  • 3:19 - 3:22
    taking on-- let me do that in
    blue since I already wrote the
  • 3:22 - 3:29
    0-- 0 minus our mean-- let
    me do this in a new
  • 3:29 - 3:32
    color-- minus our mean.
  • 3:32 - 3:33
    That's too similar
    to that orange.
  • 3:33 - 3:35
    Let me do the mean in white.
  • 3:35 - 3:42
    0 minus our mean, which is p
    plus the probability that we
  • 3:42 - 3:49
    get a 1, which is just p-- this
    is the squared distance,
  • 3:49 - 3:50
    let me be very careful.
  • 3:50 - 3:53
    It's the probability weighted
    sum of the squared distances
  • 3:53 - 3:54
    from the mean.
  • 3:54 - 3:56
    Now what's the distance-- now
    we've got a 1-- and what's the
  • 3:56 - 3:57
    difference between
    1 and the mean?
  • 3:57 - 4:05
    It's 1 minus our mean, which
    is going to be p over here.
  • 4:05 - 4:09
    And we're going to want to
    square this as well.
  • 4:09 - 4:11
    This right here is going
    to be the variance.
  • 4:11 - 4:13
    Now let's actually
    work this out.
  • 4:13 - 4:16
    So this is going to be
    equal to 1 minus p.
  • 4:16 - 4:19
    Now 0 minus p is going
    to be negative p.
  • 4:19 - 4:22
    If you square it you're just
    going to get p squared.
  • 4:22 - 4:24
    So it's going to be p squared.
  • 4:24 - 4:31
    Then plus p times-- what's
    1 minus p squared?
  • 4:31 - 4:39
    1 minus p squared is going to be
    1 squared, which is just 1,
  • 4:39 - 4:41
    minus 2 times the
    product of this.
  • 4:41 - 4:47
    So this is going to be minus
    2p right over here.
  • 4:47 - 4:50
    And then plus negative
    p squared.
  • 4:50 - 4:54
    So plus p squared
    just like that.
  • 4:54 - 4:59
    And now let's multiply
    everything out.
  • 4:59 - 5:01
    This is going to be, this term
    right over here is going to be
  • 5:01 - 5:04
    p squared minus p
    to the third.
  • 5:04 - 5:07
    And then this term over here,
    this whole thing over here, is
  • 5:07 - 5:10
    going to be plus
    p times 1 is p.
  • 5:10 - 5:15
    p times negative 2p is
    negative 2p squared.
  • 5:15 - 5:19
    And then p times p squared
    is p to the third.
  • 5:19 - 5:22
    Now we can simplify these.
  • 5:22 - 5:24
    p to the third cancels out
    with p to the third.
  • 5:24 - 5:28
    And then we have p squared
    minus 2p squared.
  • 5:28 - 5:32
    So this right here becomes,
    you have this p right over
  • 5:32 - 5:34
    here, so this is equal to p.
  • 5:34 - 5:38
    And then when you add p squared
    to negative 2p squared
  • 5:38 - 5:43
    you're left with negative p
    squared minus p squared.
  • 5:43 - 5:46
    And if you want to factor a p
    out of this, this is going to
  • 5:46 - 5:51
    be equal to p times, if you take
    p divided p you get a 1,
  • 5:51 - 5:52
    p square divided by p is p.
  • 5:52 - 5:57
    So p times 1 minus p, which is
    a pretty neat, clean formula.
  • 5:57 - 6:00
    So our variance is p
    times 1 minus p.
  • 6:00 - 6:04
    And if we want to take it to the
    next level and figure out
  • 6:04 - 6:06
    the standard deviation, the
    standard deviation is just the
  • 6:06 - 6:12
    square root of the variance,
    which is equal to the square
  • 6:12 - 6:17
    root of p times 1 minus p.
  • 6:17 - 6:20
    And we could even verify that
    this actually works for the
  • 6:20 - 6:22
    example that we did up here.
  • 6:22 - 6:25
    Our mean is p, the probability
    of success.
  • 6:25 - 6:27
    We see that indeed it
    was, it was 0.6.
  • 6:27 - 6:30
    And we know that our variance is
    essentially the probability
  • 6:30 - 6:33
    of success times the probability
    of failure.
  • 6:33 - 6:35
    That's our variance
    right over there.
  • 6:35 - 6:40
    The probability of success
    in this example was 0.6,
  • 6:40 - 6:42
    probability of failure
    was 0.4.
  • 6:42 - 6:45
    You multiply the two, you get
    0.24, which is exactly what we
  • 6:45 - 6:47
    got in the last example.
  • 6:47 - 6:48
    And if you take its square
    root for the standard
  • 6:48 - 6:52
    deviation, which is what we
    do right here, it's 0.49.
  • 6:52 - 6:54
    So hopefully you found that
    helpful, and we're going to
  • 6:54 - 6:58
    build on this later on in some
    of our inferential statistics.
  • 6:58 - 6:58
Title:
Bernoulli Distribution Mean and Variance Formulas
Description:

Bernoulli Distribution Mean and Variance Formulas

more » « less
Video Language:
English
Duration:
06:59

English subtitles

Incomplete

Revisions