**These are draft notes extracted from subtitles. Feel free to improve them. Contributions are most welcome. Thank you!**

**Please check the wiki guide for some tips on wiki editing.**

Contents

- 1 18. Binomial Distribution
- 1.1 01 Binomial
- 1.2 02 Binomial Solution
- 1.3 03 Heads Tails
- 1.4 04 Heads Tails Solution
- 1.5 05 Heads Tails 2
- 1.6 06 Heads Tails 2 Solution
- 1.7 07 5 Flips 1 Head
- 1.8 08 5 Flips 1 Head Solution
- 1.9 09 5 Flips 2 Heads
- 1.10 10 5 Flips 2 Heads Solution
- 1.11 11 5 Flips 3 Heads
- 1.12 12 5 Flips 3 Heads Solution
- 1.13 13 10 Flips 5 Heads
- 1.14 14 10 Flips 5 Heads Solution
- 1.15 15 Formula
- 1.16 16 Formula Solution
- 1.17 17 Arrangements
- 1.18 18 Arrangements Solution
- 1.19 19 Binomial 1
- 1.20 20 Binomial 1 Solution
- 1.21 21 Binomial 2
- 1.22 22 Binomial 2 Solution
- 1.23 23 Binomial 3
- 1.24 24 Binomial 3 Solution
- 1.25 25 Binomial 4
- 1.26 26 Binomial 4 Solution
- 1.27 27 Binomial 5
- 1.28 28 Binomial 5 Solution
- 1.29 29 Binomial 6
- 1.30 30 Binomial 6 Solution
- 1.31 31 Conclusion

So we talked about coin flips, and we flipped some coins.Now, I want to flip many coins including this 2-dollar coinwhose country of origin I just don't remember.Perhaps you can post on the forum where this 2-dollar coin might be from.So let's ask an easy quiz. Suppose we do 2 coin flips.I would like to know how many outcomes of these 2 coin flips are thereand which number of heads equals the number of tailswhich in this example means you would have head exactly once and tails exactly once.Give me that number.

And the answer is 2. If you look at the truth table—head-head, head-tail, tail-head, and tail-tail—these are the four possible outcomes.Those two outcomes over here yield an equal number of heads and tails.

Let's now go to 4 coins and ask the same question.

In going through the truth table, there's a bit more info.So let's find the one where the number of heads and tails are the same.Those three on the left side and those three on the right side for a total of 6.

Now. Let's go to 5 coin flips.How many outcomes have the same number of heads and tails? This is a trick question.

And the answer is 0. With an odd number of coin flips, one has to be more than the other.There's no other way. Okay. I tricked you a little bit.

With 5 coin flips, how many outcomes will have exactly 1 heads, hence 4 tails.

The answer is 5. There's 5 different ways in these 5 outcomes.To place heads--could be first, second, third, fourth or fifth. So these are 5 different ways.

Let's now make you think really hard. In 5 coin flips, how many outcomes will you have 2 heads.This is a serious and non-trivial question.

And the answer is 10 and this is a non-trivial answer.So you could go and place the first heads anywhere in these five elements--say here--and there's five different ways to place heads.You can now place the second heads among the remaining four--for example, you could place itover here and it gives you a factor of four different ways of placing the second heads.But again you do this, you over count--you over count exactly by a factor of 2 in the business.You place the first heads over here, the second over here, but if it was chosen to placethe first head on the right side and the second head over here on the left side,and the outcome would've been exactly the same, so you counted the one twicewhich means we have to divide it by 2--5 times 4/2 is 10

Let's now go to 3 heads if you think the result is no.

And the log is 10 again. There's two proofs.One is I can just flip heads into heads. So three heads means two tails.I can give the exact same game as before where I placed tails as opposed to headsand it gives me the same equation as before, but let's do it the new way, three heads.I can place 5*4 3--the first heads, the second and the third.*For the first, I have five positions, for the second--four, and for the third--three are left.This gives me the common networks for those heads, but now I'm over counting.How much am I over counting?Well, suppose I'm committed to put the three heads into the three slots over here and that's not given.And I just wonder in which order I've put them in,so I might put the first one here, the first one here, the first one here.Then for the first one placed in here, there's now three different ways of placing it.For the second one, there's two different ways of placing it.For the third one, it's not deterministic--there's just one slot left.So I over count this by a factor of 6--there are 6 different ways of placing these three headsinto these three slots, so the result is 5

Let's say I have 10 coins. You just get 10 of these shiny silver coins here. So we got 10 coins.And I got about 4 heads in these 10 coins, and just apply the same logic to find an answer.The first time I'll do it for you.I can place those heads in 10*9 87 different slots if they were counted.*Now that I'm committed to having chosen these slots, the implementations of those are 4

I was given 10*9 876 which is 30,240 whereas in picking those five heads*and we're over counting by 5

So let me give you the mathematical formula that you might be familiar with.n! for any number n is the same as n*(n-1) (n-2) all the way to times 1.*Let's call it factorial. So 10 factorial for example will be 10

And this one is the correct one and I have to admit I must like you a little bitby taking a symmetric example where k is exactly half of n.

The key observation is that this thing over here is n!/(n-k)!and to see this let's go back to the case where we had 4 heads.In the 4 heads case, we multiplied all the way to times 5 over here.We only multiplied all the way to 7. These are the 4 heads that we placed.So n! goes from 10 all the way to 1. (n-k)! goes from 10-4 and that's 6 all the way to 1.So this blue expression over here will go from 10 x 9 x 8 and so on all the way to 1over now n-k, 10-4 is 6. 6*5 4 and so on.*When you look at this, the 6

So, I get 317,750, and the logic is I just plug in these numbers, 125!/122! 3!.When I evaluate this, I find that these guys can be easily reduced to 125*124 123.*From 122 on, these factors exactly cancel. 3 expands to 3

And let's really ask about probabilities.Let's say for now, we have a fair coin with a probability of heads is 0.5.If I flip a coin five times, what's the probability the number of heads is exactly 1.You should be able to compute this.

Now, we know from our previous considerationthat there are five ways in which the number of heads could be one.5!/4! 1! happens to be 5.We also know that there are 32 possible outcomes. It is 2⁵=32 outcomes.This is the size of a truth table. So, 5 out of 32 outcomes has exactly 1 head.So, I would suggest that the answer is 5/32, and my calculator tells me this is 0.15625.So, that is actually interesting.If you flip a coin five times, there's a chance that it only comes at head exactly onceand that is the probability 0.15625.

Let's now modify it and ask, what are the chances it becomes a head three times?What's the probability for that to happen?

And the answer is 5!/5-3 is 2!/3! and that gives us 10. 10/32 gives us the probability of 0.3125.

Now, I'm going to make it really difficult. I'm going to give you a coin--let's call it loaded.So, the probability for heads will now be 0.8 and therefore the probability for tails is 0.2.To make it easier, assume only a 3 coin flipsand ask the probability of heads coming up exactly once.What is that probability for the loaded coin without giving you a head.I recommend answering it using a truth table.

So here is my truth table of these eight different outcomes.The ones that has head exactly once are this one, this one, and this one,but they're not all equally likely.Heads, heads, heads is much more likely than say tails, tails, tailsbecause heads has a probability of 0.8.This one here has an outcome probability of 0.8³ while this one has an outcome probability of 0.2³.All of the green once have the same outcome probability.They all have exactly one head 0.8 and two tails.So as before, we took the probability to be one of these has the truth table.This time each of those has a probability of 0.032. That's each amount of the three.Now, we have to consider all of these three outcomes, which means you're going to add 0.032for each one of those three guys over here and this gives me as an answer 0.096.That's a nontrivial question.

Let's now say for the same loaded coin, we flip that coin five times with that same load of probabilityover here and the key about the out of five times heads comes exactly four times.Now, I want you to compute this probability over here, It's a completely nontrivial question.If it's too hard, hit the next button.

So interestingly enough, we can do the trick as before 5!/4!*1!,*which is the number of outcomes at exactly 4 heads and we know that's 5.Four heads means one tails. There's five ways took place and one tails and this one over here.The question now what's the probability of those?Well, they have heads four times, (0.8)⁴ and tail once to (0.2)¹.So we do is we multiply the total number of outcomes that have this propertywith each of probability, which happens to be the same because we get exactly four times headsand 1 times tail and multiplying these things together gives us 0.4096.This over here is indeed 0.4096 and the 5*0.2 cancels the others out,*so that's the result in this specific case.The cancellation doesn't always happen. It's a rare circumstance.

So, this does not go and get the same for 3 heads.I leave this here, but obviously, the numbers aren't correct anymore.

And here is my answer 5!/3!*2! is 10,*and we have 3 heads, so we put 3 in here and 2 tails, so we put 2 in here.Putting these all together gives us 0.2048, which is half the probability of the previous question.

Now, you're ready for the real challenge.You flip the coin 12 times in the care about how likely it is to get heads 9 times out of the 12.This is not a trivia question, but you should be able to get it right.

And the approximate answer is 0.236.That's the probability of exactly 9 heads out of 12 coin flipsfor this heavily loaded coin that mostly gives you heads.And again, the answer is 12!/12-9. This is 3! 9!.Then we have to compute the probabilities being (0.8)⁹and 1-0.8 is 0.2³ and that is the number over here.

What have you learned? Well, to flip a coin n times one for k small or equal to n.We ask the probability--what are the chance it comes up heads k times.For any coin, with the probability of heads equals to all caps P,.we now get the following formula: n!/(n-k)!*k!.*These are the total number of outcomes that have this property.And then this one has the following probability:P to the k, this was the (0.8)⁹ before times (1-p) to the n-k,which is the remaining 3 over here in this example.So, this formula is the probability of what's call the binomial distributionand really was this is the accumulated outcome of many identical coin flips,and it leads us beautifully to our next lessonwhen we talk about very large experiments and the normal distribution.What you should have learned and understand now is you can take very large experimentswith large numbers of coin flips and compute the probability that heads comes a certain numberof times using the formula that you should now fully and wholly understand.