Welcome to our next module in an Intuitive Introduction to Probability decision-making in an uncertain world. In this module I want to show you a bunch of applications of probabilities. As I said at the very beginning of this course, many people tell me "I hate probability." And I think that attitude comes from that many people don't really see cool, real-world applications that are really relevant in everyday decision-making, or relevant to the well-being of our societies. And here I really want to convince you that there are cool applications. We want to start with some playful applications. Today in the first lecture we're going to look at the Birthday Problem. And then later on we get into some more serious stuff from business or the law. So, let's just dive into the Birthday Problem. What is that about? You go to a party and there's a bunch of people in the room. And here is now the question: what is the probability that there's at least one pair of people at this party who have birthday on the same day of the year? Two people having birthday on January 18th or March 22nd or July 1st. And then the related question: How many people do you have to have at this party, so that this probability of at least one pair of birthday people in the room is larger than a half, larger than 50%? These two questions together give us a Birthday Problem. Before I tell you how to think about this here's an in-class quiz question for you. Let's go back to the second question: How many people do you need to have in a room so that the probability of at least one pair is larger than 50%? Here I have a bunch of options of possible answers. Exactly one of them is correct. Please have a go at it, and then afterwards I will tell you how we can calculate these probabilities. Welcome back from the in-class quiz question. Now I want to show you how we can calculate these probabilities. I've prepared an Excel sheet called Birthday Problems. Now, before I show you the calculations in that sheet, I want to tell you a little bit about the strategy on how we calculate the probabilities that I mentioned before. It's actually a really tricky question to think about how many people may have birthday on the same day because maybe there's one pair, maybe there are two pairs maybe there are 3 or more pairs, maybe there are triplets. There are so many possibilities that it quickly gets totally overwhelming. And I can tell you, I have no idea on how to calculate those probabilities that way. But I can show you much more elegant, much more simpler way. Let's use the Complement Rule, remember this was one of the key rules that we learned about in the every first module. So the probability of the complement of an event is 1 minus the probability of the event. What's the opposite of having at least one pair, or 2 pairs or some more? Ha! The opposite is very easy, very well defined. All of us at this party, all the people in this room having birthday on different days. And it turns out, that probability can be calculated quite easily. So now, come with me to the Excel sheet and I'll show you how we can calculate that probability. Here we are now at the spreadsheet for the Birthday Problem that I prepared Before we get into the calculation, I need to state my assumptions which are listed over here in column E. First, we assume there's no February 29th so we assume there are only 365 days in the given year. All of those days are equally likely and we assume all the people in the room are independent. That means your birthday doesn't affect mine our birthdays don't affect anyone else's and so on. And as I now said before, we are not yet calculating the probability of the event we really care about, that there's at least one pair, instead we're looking at the complement. What's the probability that all of us in the room have their birthday on different days? We look at Person 1, Person 1 can choose his or her birthday any day in the year. It get's interesting with Person 2. This person now has only 364 out of 365 days left, why? The first person picked the day, Oh, that's my birthday and now we want the second person to be different well, that leaves only 364. And so now I start calculating these probabilities here. One, anything goes for the first person times 364 divided by 365. So this number here, the .99726 is the probability that a pair has birthday on different days. Now the third person enters the party. What's the probability that her birthday is different than of the first 2 people? Ah! Two days are taken in the year. That means 363 days are left. So we multiply with 363 divided by 365 and get this probability a little less that 99.2%. You now see as more and more people enter the room the probability of being different gets a little smaller, little smaller and independence, we multiply all of them. And so now what happens is that this product gets smaller and smaller and smaller. Now the amazing thing here is that the probability drops below a half already at 23. So, as soon as there are 23 people in the room and assuming our assumptions apply, then the probability of all of us having birthday on a different day is already below a half. That now means of 23 people, the probability of at least one pair is larger than a half. that's very counter-intuitive and quite surprising. So often people tell me this can't be true, how can this be? Now, I calculated probabilities for many other numbers including 45, 45 is under 6% And now for 45, I also prepared a Monte Carlo simulation. How does this work now? Let's go here to the second sheet. Here now I randomly pick 45 numbers and that's very easy in Excel. There's this cool function RANDBETWEEN and then I do 1 SIM I call on 365 on this Swiss computer, in the United States it's 1 comma 365 whatever it is in your language, and this gives me a random number between 1 and 365. I do this for all 45 people. And then I compare, look at all pairs. So here I compare Person 2 to Person 1. I compare Person 3 to Person 1 and 2. Here I compare Person 10 to the first 9. If I see a match between Person 8 and 5 as I indicate here then I get a 1, otherwise the spreadsheet shows me a zero. Now at the top here, I count the number of matches we have in our spreadsheet. And now I can recalculate the sheet, either by clicking a button here or in a Windows computer, easily F9 and I create 45 new birthdays a new party, 45 new people, and I check is there a pair? Look at this, right now I have 2 pairs and so I guess there's at least 1 match. I do it again, 3 pairs. I do it again, another 2 pairs. Two pairs, 4 pairs, wow! Look at this, 3 pairs, 1 pair. Now, you see, it's hard to hit a zero. Do it for a while, and eventually you will also occasionally hit a zero, I can tell you in less than 6% of all times. Before I return the spreadsheet, I want to do one last detour. People find this so strange, how can it be that with 23 people we already have a likelihood larger than a half, of having a pair? Now let me go the third and last sheet on my Excel spreadsheet here. Now we change the problem. Here the question is now: What is the probability that at least 2 people have a birthday today, or the complement that nobody of us has a birthday today? This is a fundamentally different problem. Why? I fix the day. I said let's look at birthdays today. This now rules out you and me having birthdays on the same day of the year that's different than today. That's in the previous version of the problem that was a hit that was a match, that was a pair. And there are so many days, 365, where you and I could have a birthday together. Here now, that birthday has to be today. Now the probability calculation changes. Here now, notice the different definition. Now we are looking at the probability that all of us do not have a birthday today. Now, for each of us, the probability of not having a birthday today is 364 divided by 365, it doesn't decrease. You and I can have both birthday yesterday. That's still not a match here, so now the probability as you see here in my spreadsheet is 364 divided by 365 to the power of the number of people in the room. Independence, your probability not today 364 divided by 365 times my birthday, not being today 364 times 365 times and so on for all of them. And now you may think, oh I need 183 people for this to be 50/50. Why do people think this? Oh, that's 365 divided by a half is 182.5, so if a 183 people this will be about a half. Wrong. Because from those 183 people, quite a few will have birthdays on the same days. And therefore, it's not that we have covered half a year for sure with 183 people, actually less. You can now play with this, and the surprising result is that you need 253 people at your party to have a probability of more than a half, that at least one of them has a birthday today. That's a very different calculation. So let me sum this up one more time. In this last instance of the problem, the question was what's the probability that you have someone having a birthday today, so today and a person's birthday matches. That's very different than in the original Birthday Problem at the beginning here, where it can be any day of the year. And so I think this helps a lot of people to get over this counter-intuitive result that you only need 23 people to have a match on some day of the year. Not today, but some day of the year. This wraps up the Excel spreadsheet discussion. Play around with it a little bit more if you want. And now let's summarize everything in these slides and return there. Here we are back from our Excel sheet. Let me briefly summarize our calculations. We made the following assumptions: there are 365 days in a year. So we are ignoring February 29th. We assume that all days are equally likely and finally, that we are all independent of each other. Your birthday doesn't affect mine, nor anyone else's in the room. And then we just saw the probability now of the complement of the original event, namely all of us having birthday on different days is one big long multiplication. The first person can have birthday on any given day. The second person now needs to be different as the first person has taken a day, for example January 1st. So the second person has 364 out of 365 days left. So I multiply 1 times 364 divided by 365. Now the second person comes along in addition to the first, so in total the third person. Now this person cannot have birthday on the first 2 days that Person 1 and Person 2 had a birthday on. So that's 363 out of 365 which we multiply with the previous product and so on. And now you go on until however many people are in this room. To summarize, here are the results. On the one hand with 10 people, there's more than 88% chance that all of us that are in the room, if there are only 10 of us have birthday on a different day. With 23 people, that already drops below a half. Put differently, for the original event that we talked about what's the probability of having at least one pair? With only 23 people, that probability already exceeds a half. So the answer to that quiz question was 23, the smallest of the choices given. Now, notice once you have 60 or more people in the room, the probability of all of them having different birthdays drops below 1%. So, that means next time you are at at a party you may want to offer that bet. Yeah, I think you will be able to surprise some people. And that already brings us to the takeaways. In addition to this rather surprising, perhaps counter-intuitive result of the Birthday Problem we also have seen an application of the Complement Rule. The Complement Rule sometimes can be very, very helpful when the calculation of the probability of an event is very, very tedious, or we think maybe the Complement Rule allows me easier calculation. That's the first application in this module. Come back for more fun in the next few lectures. Thank you.