 This is a video about the binomial distribution. The binomial distribution is a probability distribution which is used when an action is repeated and we're interested in the number of successes. It gives the probability for each possible number of successes and there's a formula for calculating these probabilities. The purpose of this video is to explain the formula and show you how to use it. For example, suppose that we play a board game several times in a row. We might be interested in the probability that I win two out of these games. The binomial distribution enables us to calculate the probability that I will win two or any other number out of a sequence of games. There's a couple of things to bear in mind whenever you want to use the binomial distribution. The most important is that the probability of success must be the same in each trial. In my example, the probability of winning each game must be the same. So in particular, the trials must be independent. The outcome of one game can't affect the probability that I win the next game. Now the most important question in a study of the binomial distribution is what's the probability of getting x successes in a sequence of n trials? Let's look at some examples. Suppose that we play carcassonne three times in a row. Let's work out the probability of winning two games out of three. We can do it by drawing a tree diagram. Suppose that the probability of me winning is a third and the probability of you winning is two-thirds. I'll write s for me winning, s for success, and f for me not winning, f for failure. We can assume that the probability of me winning each game is the same and that the outcome of one game doesn't affect the probability of me winning the next one. Well you can see that there are three ways in which I can win two games out of three. I can win the first two and lose the last one or I can lose the middle one or I can lose the first one. You can also see that each way has the same probability because each time we'd have to multiply one-third, one-third, and two-thirds just in a different order. So the probability of me winning two games out of three is three times a third squared times two-thirds and if you work that out it's equal to two-ninths. Now let's look at a different example. Let's suppose that we play five games of ticket to ride in a row. Let's work out the probability of winning two games out of five. This time we'll assume that the probability of me winning a game is a quarter. Well you can infer from the previous example that the probability of winning two games out of five will be the number of different ways in which I can win two games out of five times the probability that the first two games result in a win and the final three games result in a loss. The probability of winning the first two games and losing the last three is a quarter squared times three-quarters cubed. Remember that the probability of winning a game is a quarter and so the probability of losing a game is three-quarters. The difficult thing is working out the number of ways in which I can win two games out of five. One possibility is obviously that I can win the first two games and lose the remaining three. We can find out the others by reordering the letters S S F F F but we need to do it in a logical way so that we don't miss out any possibilities. To begin with I'll keep the first S in the same place and move the second S along. That gives four possibilities. Now I'll move the first S along and put the second S next to it and move the second S along. Now we've had seven possibilities. Moving the first S along again gives a total of nine possibilities and moving both S's to the end gives a total of ten possibilities. So the number of ways of winning two games out of five is ten and that means that the probability of winning two games out of five is ten times a quarter squared times three-quarters cubed and if you work that out it turns out to be 135 over 512. Now let's address the general question. What's the probability of getting x successes in n trials? Remember this is the key question in any study of the binomial distribution. Suppose that the probability of success is p in that case the probability of failure is 1 minus p so the probability of x successes in a row followed by n minus x failures in a row is going to be p to the power of x times 1 minus p to the power of n minus x. Okay now there's some notation for talking about the number of ways of getting x successes in a sequence of n trials. You can write an n above an x and put them in brackets or you can write a c with an n above and to the left and an x below and to the right and both things you can read out n choose x. Remember this is just notation for talking about the number of ways of getting x successes in n trials. So using that notation we can say that the probability of x successes out of n is n choose x times p to the power of x times 1 minus p to the power of n minus x. So this is the key formula that you need to remember for the binomial distribution. It can be rewritten like this. In order to use the formula though we need a better way of working out how many ways there are of getting x successes in n trials. It's not very helpful if we have to count them all every time. First of all because in some cases there's a very large number and secondly because it's easy to make a mistake when counting. Fortunately there's a formula which says that n choose x is equal to n factorial over x factorial times n minus x factorial. For example it means that 5 choose 2, the number of ways of getting 2 successes out of 5 is 5 factorial over 2 factorial times 3 factorial. I'll show you how to calculate this. 5 factorial means 5 times 4 times 3 times 2 times 1. 2 factorial means 2 times 1 and 3 factorial means 3 times 2 times 1. So 5 factorial over 2 factorial times 3 factorial is 5 times 4 times 3 times 2 times 1 divided by 2 times 1 times 3 times 2 times 1. This looks horrible until you realise that most of these numbers cancel out, leaving us with just 5 times 4 over 2 times 1, which you can easily see is 10. So now we can give a more helpful version of the binomial formula. We can say that the probability of x successes out of n is n factorial over x factorial times n minus x factorial times p to the power of x times 1 minus p to the power of n minus x. And this is the key formula that you need to remember in the context of the binomial distribution. There's another method for finding the number of ways to get x successes out of a sequence of n trials. It uses Pascal's triangle. Suppose we write the binomial coefficients in the form of a triangle like this and we calculate all these coefficients. The resulting triangle is full of patterns. For example, along this diagonal are the numbers 1, 2, 3, 4, 5 and so on. Along this diagonal are the triangle numbers 1, 3, 6, 10 and so on. But the most important pattern is that each number in the triangle is the sum of the two numbers above it. For example, 3 is 2 plus 1. 6 is 3 plus 3. And 10 is 4 plus 6. We can use this pattern to create more and more rows of the triangle. For example, you can probably work out that the next row must be 1, 6, 15, 20, 15, 6, 1. Okay, well it's easy to remember the first few rows of this triangle and you can always construct more if you need to. Let's see how we can use it to find 6 choose 4. First of all, we need to find the row which starts 1, 6. The 1 at the end of the row will be 6 choose 0. So the 6 is 6 choose 1. The 15 is 6 choose 2. The 20 is 6 choose 3. And the 15 is 6 choose 4. So 6 choose 4 is 15. For small numbers, it's probably quicker to use Pascal's triangle than it is to use the factorial formula. But in any situation, it's up to you which method you want to use to calculate the answer. Okay, so let's summarise what we know about the binomial distribution. At the same time, I need to show you a bit of new notation. We've got a sequence of trials and let's call the number of trials N. In each trial, there's a probability of success which we call P and we're interested in the number of trials which result in success. And let's call this random variable X. The new bit of notation is that we can say that X follows the binomial distribution with parameters N and P. So that means that X is a random variable which has the binomial distribution where there are N trials and P is the probability of success. What we've discovered is a formula for the probabilities. We can say that the probability that X trials out of N result in success is N choose X times P to the power of X times 1 minus P to the power of N minus X. And we can also write that like this. We know that N choose X is equal to N factorial over X factorial times N minus X factorial. So we can also say that the probability of getting X successes out of N trials is N factorial over X factorial times N minus X factorial times P to the power of X times 1 minus P to the power of N minus X. Let's look at some examples. First of all, suppose we have a random variable which is equal to the number of successes in a sequence of six trials where the probability of success is two-fifths. What's the probability of four successes out of six? Well, the probability of four successes will be 6 choose 4 times two-fifths to the power of 4 times three-fifths squared. We know from our earlier work that 6 choose 4 is equal to 15. So the probability that X is equal to 4 is 15 times two-fifths to the power of 4 times three-fifths squared. And if you work that out, that's equal to 0.138 to three significant figures. Here's another example. Suppose that X has the binomial distribution where there are 10 trials and the probability of success in any one trial is three-quarters. What's the probability that X is equal to 8? Well, the probability of eight successes out of 10 will be 10 choose 8 times three-quarters to the power of 8 times a quarter squared. We'll have to work out 10 choose 8 and let's use the factorial formula. 10 choose 8 is 10 factorial over 8 factorial times 2 factorial. That's the same as 10 times 9 times 8 times 7 times 6 times 5 times 4 times 3 times 2 times 1 divided by 8 times 7 times 6 times 5 times 4 times 3 times 2 times 1 times 2 times 1. Fortunately, most of those numbers cancel out so that all we're left with is 10 times 9 over 2 times 1, which is 45. So that means that the probability that X is 8 is equal to 45 times three-quarters to the power of 8 times one-quarter squared. And if you work that out, it's equal to 0.282 to three significant figures. One last example. Suppose I throw five dice. What's the probability of getting two multiples of three? The thing we're interested in here is the number of multiples of three. So let's say that the random variable X is the number of multiples of three. We can say that X has the binomial distribution where five is the number of trials and a third is the probability of success. The chance of getting a multiple of three must be a third because there are two multiples of three and six possible numbers. The question is asking us for the probability that X is equal to two. It's asking us how likely we are to get two multiples of three. And we know that the probability that X is two is five-choose-two times a third squared times two-thirds cubed. Using Pascal's triangle, we can see that five-choose-two is 10. So the probability that we're looking for is 10 times a third squared times two-thirds cubed. And if you work that out, it's equal to 0.329 to three significant figures.