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

## Video transcript

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 just visualize that in this video we will actually plot these and we got a sense of this random variables probability distribution so let's do that so let's let's see maybe actually maybe I'll do it like this so that we can so that we can see the probabilities and actually I can let me erase this business right over here whoops that's not working let me hear 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 all right so the at one axis I'm going to put all of the different outcomes so let me it looks like a pretty straight line and then this asked 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 we have let's see it's all going to be in terms of 30 seconds and we get as high as 10 30 seconds so let's say this right over here is that right over there is 10 30 seconds and 30 seconds half way up there we have subt we have 2 5 30 seconds so let's see that looks like about half that right over there is 5 30 seconds and then 1/32 would be about this it's 1 to see our split up 1 2 3 actually let me do it a little bit 1 2 3 4 5 all right so let's say this is 1/32 right over here and our probabilities so this right over here probability so this is what the R and the values that the random variable could take on so I'll just make a little histogram here so X equal zero and then and the probability there and actually since I want to do a histogram it will look like this so let me do a little bit different so right here so X is equal to zero right there the probability is 1/32 I can shade that in now I have the probability that x equals one x equals one is five thirty Seconds so let me draw that so five thirty seconds so put the bar there so let me shade that in this right over here is the probability that X is equal to one that we get one what that one exactly one out of the five flips result in heads now we have the probability x equals two x equals two is ten thirty Seconds so that's going to look like this that's going to be look like this alright my best attempt at hand drawing it so somehow I like the aesthetics of hand drawn things more sometimes if you just get a computer to graph its I don't know sometimes loses a little bit of its personality alright so that right over there is the probability that we get that X that our random variable X is equal to two then we have the probability that x equals three which is also ten thirty seconds so that is also ten thirty seconds so let me draw that this is also ten thirty seconds shade this in I'm too dumb to dumb all right I find this strangely therapeutic alright so this is the probability that X is equal to three now x equals four that's five thirty seconds so we go back right over here that's five thirty seconds so a that one in this right over here is X is equal to four and then finally the probability that x equals five is 1/32 again it's the same same level as this right over here shade it in so this right over here is a random variable X equaling five and so when you visually show this probability distribution it's supporting 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 you know an infinite number of discrete values you could just keep counting higher and higher and higher but this is discrete and that it's kind of 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 0 x equals 1 x equals 2 x equals 3 x equals 4 or x equals 5 and you see when you plot it's it's it's probability distribution this discrete probability distribution you have it you know 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 but 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 a lot of discrete processes one might assume that the underlying distribution is a binomial distribution and when we get further in to fit into statistics we will we'll talk why people do that now if you were to if you were to have if you have much more than 5 cases here if instead of saying that the number of heads for flipping a coin five times you said X is equal to the number of heads flipping a coin five million times then you can imagine you'd have much much you know 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 we 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 if you as one way to think about it is the normal distribution is the probability density function it's a continuous case so the yellow one that we're approaching a normal distribution and a normal distribution and 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 it's a-okay it's the product of kind of an almost an infinite number of random processes happening here we're taking a coin we're flipping it five times but if you imagine kind of 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 you know these 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 your 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 statistics because it is reasonable to assume an underlying binomial distribution or a normal distribution for a lot of different types of processes but sometimes it's not and you know even in things like economics sometimes people assume a normal distribution when 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 appreciate hey you know 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 if you had many many more flips and you defined the random variable in a similar way then this then the this histogram is going to look a lot this bar chart it's going to 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 be that would get us closer to a normal distribution