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

Visualizing a binomial distribution

Sal walks through graphing a binomial distribution and connects it back to how to calculate binomial probabilities.

Want to join the conversation?

  • male robot hal style avatar for user Siddhartha
    Can someone sum up the differences and similarities between discreet, continuous, normal, and binominal distribution. Did I got it right in saying that
    1) binomial distribution approaches normal distribution with increase in sample size.
    2) discreet distributions generated by random process are binominal distributions.
    (6 votes)
    Default Khan Academy avatar avatar for user
    • orange juice squid orange style avatar for user Ethan Peritz
      Hi there. Let me respond to each of your points in turn.

      1) I would agree with you with a couple of clarifications. Let's say you are guessing randomly on a multiple choice test with 10 questions, and each question has 5 answer options with only one correct option. So, your probability of a correct answer is .2, and an incorrect answer is .8. If you Fill out the distribution and graph it, the resulting graph's shape will appear normal, but shifted over towards the left. This is because of the probability involved. Sal's example in this distribution has a .5 probability, which results in a symmetrical distribution, and, as you said, increasing the number of "flips" or events will move the distribution towards a perfect bell curve. If the probability of the event is not .5, then your distribution will be normal but shifted so that it peaks at the mean of the distribution, which can be found using the formula mu=np, where n is the number of events, and p is the probability of success.

      2) A discrete distribution generated with randomness will be binomial only if the events are binomial.. So, we must have success, failure, and absolutely nothing in between. We cannot make this distribution for the probability of snowy days, rainy days, and sunny days. We would have to define it so that we are only interested in "sunny" and "not sunny," for example.

      I hope that helps out!
      (25 votes)
  • winston baby style avatar for user OSK
    Is it that, Binomial distribution is applicable if the possible outcomes of an experiment is 2? like flipping a coin?
    What if it is rolling a dice, where we have 6 outcomes of the experiment, is it Binomial is not applicable in this case?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • primosaur ultimate style avatar for user Shrihan Dadi
    Do the Bars in the Histogram have anything to do with the Riemann Sum of the Bell Curve?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leafers ultimate style avatar for user Austen Jones
      Yes, they do. You can think of the width of the bars getting narrower and narrower the more possible outcomes there are on the x-axis. For example, if instead of only having the options of one through five, you have one to infinity but it all fits on the x-axis you'd get these really skinny bars and they'd tend toward looking like the bell curve if you get a lot of them, similar to the way that Reimann sums care about minimizing the width of the columns to a really tiny distance and then taking the sum of the areas of the columns.
      (3 votes)
  • blobby green style avatar for user Ductomon
    Around , is a normal distribution by definition continuous? How does a very large discrete (binomial?) distribution (flip a coin 5 trillion times) differ from a normal distribution?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • male robot johnny style avatar for user Thomas B
      It doesn't differ significantly beyond the fact that you have discrete results (which can be easily accounted for using a continuity correction). This is the premise of the Central Limit Theorem which states that "the mean of many random variables independently drawn from the same distribution is distributed approximately normally, irrespective of the form of the original distribution" (wikipedia.org)
      (5 votes)
  • duskpin ultimate style avatar for user #1 βooκs ρroρonεnτ
    What is the difference between the "bell curve" and a Gaussian, to me they look the same,but maybe i'm missing something. :P
    (3 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Nadia
    Why do we use a histogram if it is a discrete variable? Would we not want to use a bar graph instead?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user daniella
      The terms "histogram" and "bar graph" are sometimes used interchangeably, but they serve slightly different purposes. A histogram is used to represent the distribution of numerical data and is a type of bar graph. In the context of discrete random variables, what's important is the representation of the probability of each outcome, which a bar graph accomplishes effectively. The use of a histogram in the video likely refers to a bar graph visualizing the probability distribution of discrete outcomes.
      (1 vote)
  • blobby green style avatar for user Sw1fty
    please i want to know what id P(X<or= x)
    or if P(X>or= x) what is the formula an why is that the formula
    for both geometric and binomial distributions
    please
    and if its difficult to explain with this format, you an write it in paint and take a screenshot with https://snag.gy/
    (3 votes)
    Default Khan Academy avatar avatar for user
  • aqualine seed style avatar for user Shubham Gupta
    Why did we use a histogram to represent the distribution? The index is not a continuous variable and there is no range for which the bar represent. It must be a bar chart.
    (2 votes)
    Default Khan Academy avatar avatar for user
    • leaf blue style avatar for user Dr C
      To expand on Victoria's answer, there are a couple more reasons why using a histogram is preferred to visualize the Binomial distribution:

      1. The alternative to using a histogram would be to use a line graph. So instead of a bar centered over each value, we would just have a single line at the value. A histogram is generally considered to look better.

      2. With bar widths of 1 unit, using the histogram means that the probability of any given value can be visualized by shading that bar and using geometry (area=base*height). This provides a nice consistency between discrete and continuous random variables in terms of representing a probability.

      3. Sometimes we use continuous distributions to approximate discrete distributions. When we do this, there is a "continuity correction" that gets applied. Using the histogram makes this continuity correction more intuitive.
      (2 votes)
  • piceratops ultimate style avatar for user sarthak mehra
    Why does sal not mark X=0 at the origin and then the associated probability at the y axis ?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • male robot johnny style avatar for user Yuganes warman
    what if we do more than 5 flips ? say we do 100 flips of coins to find the probability of obtaining heads. won't it be a normal distribution graph (the bell graph ) ?
    (1 vote)
    Default Khan Academy avatar avatar for user

Video transcript

- [Voiceover] In the last video, we set up a random variable x, which was defined as the number of heads from flipping a fair coin five times, and then we figured out the probability that our random variable could take on the value zero, one, two, three, four, or five, and just to visualize that, in this video, we will actually plot these, and we'll get a sense of this random variable's probability distribution. So let's do that. Actually, maybe I'll do it like this, so that we can see the probabilities. Actually, let me erase this business right over here. Whoops, that's not working. Here, that might work. Let me erase this real fast, these little scribbles that I had off-screen, and then we can actually plot the distribution. Alright, so at one axis, I'm gonna put all of the different outcomes. So let me... That looks like a pretty straight line, and then at this axis, I'm going to plot the probabilities. And that looks like a pretty straight line, and let's see what the probabilities are. We have, let's see, it's all gonna be in terms of 32nds, and we get as high as 10/32, so let's say this right over here is 10/32, half-way up there, we have two 5/32, so let's see, that looks like about half, that right over there is 5/32, and then 1/32 would be about this, that's one, two, let's see... If I were to split it up, one, two, three... Actually let me do it a little bit... One, two, three, four, five. Alright, so let's say this is 1/32 right over here, and our probabilities, so this right over here, probability, so this is the values that the random variable could take on, so I'll just make a little histogram here, so x equals zero, and the probability there, and actually since I want to do a histogram, it will look like this, so let me do it a little bit different. So, put it right here, so x is equal to zero. Right there, the probability is 1/32, and I can shade that in. Now, over the probability that x equals one, x equals one is 5/32, so let me draw that, so 5/32, so, put the bar there, so let me shade that in, so this right over here is the probability that x is equal to one, that we get one, that one, exactly one, out of the five flips result in heads. Now we have the probability x equals two. x equals two is 10/32, so that's going to look like this. Alright, my best attempt at hand-drawing it. Somehow I like the aesthetics of hand-drawn things more. Sometimes if you just get a computer to graph it, I don't know, sometimes, it loses a little bit of its personality. Alright, so that right over there is the probability that our random variable x is equal to two. Then we have the probability that x equals three, which is also 10/32. So that is also 10/32, so let me draw that. So this is also 10/32, shade this in. Dum-de-dum-de-dum, alright. I find this strangely therapeutic. (chuckling) Alright, so this is the probability that x is equal to three. Now x equals four, that's 5/32. So we go back right over here, and that's 5/32. So, shade that one in. So this right over here is x is equal to four, and then finally, the probability that x equals five is 1/32 again. Same level as this right over here, shade it in, so this right over here is, our random variable x equaling five. And so, when you visually show this probability distribution, it's important to realize, this is a discrete probability distribution. This is a discrete random variable. It can only take on a finite number of values. Actually, I should say it's a finite discrete random variable. You could have something that takes on discrete values, but in theory, it could take on an infinite number of discrete values. You could just keep counting higher and higher and higher. But this is discrete, in that it's these whole, these particular values. It can't take on any value in between, and it's also finite. It can only take on x equals zero, x equals one, x equals two, x equals three, x equals four, or x equals five, and you see when you plot its probability distribution, this discrete probability distribution, it starts at 1/32, it goes up, and then it comes back down, and it has this symmetry, and a distribution like this, this right over here, a discrete distribution like this, we call this a binomial distribution, and we'll talk in the future about why it's called a binomial distribution, but a big clue... Actually, I'll tell you why it's called a binomial distribution, is that these probabilities, you can get them using binomial coefficients, using combinatorics. In another video, we'll talk about, especially when we talk about the binomial theorem, why we even call those things binomial coefficients. It's really based on taking powers of binomials in algebra, but this is a very, very, very, very important distribution. It's very important in statistics, because for a lot of discrete processes, one might assume that the underlying distribution is a binomial distribution, and when we get further into statistics, we'll talk why people do that. Now, if you were to have much more than five cases here, if, instead of saying that the number of heads from flipping a coin five times, you said, x is equal to the number of heads of flipping a coin five million times, then, you can imagine, you'd have much, much... The bars would get narrower and narrower relative to the whole hump, and what it would start to do, it would start to approach something that looks really, something that looks really like a bell curve. I think I'm gonna do that in a color that you can see better, that I haven't used yet. So, it would start to look... So if you had more and more of these, if you had more and more of these possibilities, it's going to start approaching what looks like a bell curve, and you've probably heard the notion of a bell curve, and the bell curve is a normal distribution. So one way to think about it, is the normal distribution is a probability density function. It's a continuous case. So, the yellow one, that we're approaching a normal distribution, and a normal distribution, in kind of the classical sense, is going to keep going on and on, normal distribution, and it's related to the binomial. You know, a lot of times in statistics, people will assume a normal distribution, because you can say, okay, it's the product of kind of an almost an infinite number of random processes happening. Here, we're taking a coin, and we're flipping it five times, but if you imagine molecules interacting, or humans interacting, you're saying, oh, there's almost an infinite number of interactions, and then that's going to result in a normal distribution, which is very, very important in science and statistics. Binomial distribution is the discrete version of that, and one little point of notion, these are where the distributions are, this is where they come from, this is how they're related. If you kind of think about as you get more and more trials, the binomial distribution is going to really approach the normal distribution, but it's really important to think about where these things come from, and we'll talk about it much more in a statistics, because it is reasonable to assume an underlying binomial distribution, or normal distribution, for a lot of different types of processes, but sometimes it's not, and even in things like economics, sometimes people assume a normal distribution when it's actually much more likely that the things on the ends are going to happen, which might lead to things like economic crises, or whatever else. But anyway, I don't want to get off-topic. The whole point here is just to appreciate, hey, we started with this random variable, the number of heads from flipping a coin five times, and we plotted it, and we were able to see, we were able to visualize this binomial distribution, and I'm kind of telling you, I haven't really shown you, that if you were to have many, many more flips, and you defined the random variable in a similar way, then this histogram, this bar chart, is gonna look a lot more like a bell curve, and if you had essentially an infinite number of them, you would start having a continuous probability distribution, or, I should say, probability density function, and that would get us closer to a normal distribution.