Transcription
Welcome back. So today we're introducing this concept of conditional probability. It's one of the most important ideas in probability, and it's going to allow us to do way more interesting things. This is getting us towards the real world. The idea is, what if I have two different events? Maybe A is, you know, I'm dealing out a deck of cards into hands. Maybe A is that my next card is a spade, and maybe event B is that my next card is a three. Okay, so we're going to ask questions like: We know how to compute the probability of A. We know how to compute the probability of B. But how do I take partial information? If I know that event B did happen—my card is a three—does that change my probability of event A? Can I update or refine my probability of event A given that I know some information about event B? That's the whole idea of conditional probability, and that's what we're going to talk about today.
So I want to just draw a little picture. This is going to help us. So remember, we have this probability space, this event space of all of the things that could possibly happen. We're going to call this superset Omega. And let's say that my uh event A is some subset of Omega. So we could ask ourselves, what is the probability of A? So probability of A, and we know how to compute the probability of A. Roughly speaking, I count how many times A can happen divided by the total of all of the things that could happen in Omega. Um, and if I think about it in this picture, in this kind of cartoon, it would be approximately the area of A divided by the area of Omega. In this case, maybe it's about 1 and 6 or 1 and 5, something like that. I'm just guessing. Okay. But the question we're going to ask today is, what is the probability of A given that we know event B happened? Given B. And the way we write this—it's slightly different—different. We're going to say this is the probability of A given B. This is notation. I am defining this notation of vertical bar: A given B. And it specifically means what's the probability of event A happening if I know for a fact that event B did actually happen. Okay.
And so let's draw another picture here. Let's say that this is event B. So if I know that event B happened, I know I'm I'm restricting myself to event B. Does that change the probability of event A happening? And I think the answer is probably yes. In this case, it looks way more likely that A would have happened given that event B happened. So the I'm going to write this out, and then we're going to talk through this formula. So the probability of event A happening given we know event B happened, what we essentially do is we zoom in. Now we know that event B did happen, so we live in this event B box. And now the probability of A happening given B is the probability that A and B happened—probability of A and B—that's this shaded region here, divided by the probability that B happened. Okay. So pictorially this makes a lot of sense. If I if I know for a fact, out of all of the space of things that could have possibly happened, definitely event B happened. I know that B happened. I can zoom in to only the events that correspond to B happening. So I zoom into B events, and now the probability of A happening given that B happened is the area of A and B happening divided by the area of B happening: the probability of A and B divided by the probability of B. You can work yourself through this. You can convince yourself that this is true. For me, the picture helps a lot. Is if I know event B happened, I can zoom into that that event, and now I'm looking at the probability. This is um this shaded region here is A and B, so it's the probability of A and B happening given the probability of B happening. Good. And this is one of the most important important ideas in all of probability—of conditional probability. If I have two events and I know that one of them happened, does that update my estimate of the other event having happened? Sometimes the answer is yes, and sometimes the answer is no. So I'm going to do a couple of examples, and we're going to get—it's really really intuitive. You'll see how this works uh in in no time. So let's just do some examples. Um, let's say example. Let's say um that I'm rolling dice. Okay, and my um let's say A is the event that my first uh my first die equals a three. Let's say B is the event that my second uh die or dice equals a five. And let's say C equals um the sum of the dice equals a six. Okay. So what is the probability of A, B? Let's say the probability of A given B. Does knowing that my second die roll was a five change anything about the probability of my first die? No. So this these are what are called independent. So the probability of A given B is just the probability of A is just uh one and six. And in a sense, the the way you would draw that pictorially is that A and B um like knowing something about B doesn't change my probability of A. The the ratio of this probability to this probability is the same as the ratio of A to Omega. I learning something about B doesn't change my my update about A. But what about my probability of A given C? So if I know that the sum of my two dice is six, does that change the probability of my first die being a three? Well, that's an interesting question. I want you to work out the probability. This is a a question.
Okay, let's come up with a really intuitive example where it's super crystal clear. Um, let's say that A, let's say I I draw a card, and it could either be Hearts, Clubs, Spades, or Diamonds. And remember Clubs and Spades are black, and Diamonds and Hearts are red. So it could either be red or black. It could be one of four suits. Okay. So let's say event A is that it's Spades, and let's say event B is that the card is a black card. Okay. So the probability of A alone, the probability of uh A alone is one in four. There's four suits. Probability of getting one of those suits is one and four. The probability of B is one/half. Two of the suits are black, two of the suits are red, so 50% chance you draw a black card card. Now if I happen to know that my card is black, what's the probability now that I got a spade? Okay, so that is what is the probability of A given that I know my card happened to be a black card? That now I have restricted—there's only two suits that it could possibly be: Clubs or Spades. And so the chances of my card being a spade went way up from one and four to 1/2. So knowing some information, partial information, can dramatically change the probability of an event A happening. What if event C was that my card is red? Okay, so you know let's say I tell you the card is red. What's the probability that I have a spade given that my card is red? Again, that dramatically changes the probability. There's no chance that my card is a spade if it happened to be red. So it's a really really simple idea, like this is just you know kind of a dumb example, but it gives you this idea that some partial information about another event happening can really tell you a lot more information about the event um A happening.
Uh, let's do another example. I think this one is a pretty good one. Um, let's talk about like uh screening for some disease like cancer. Okay. Um, I thought about making this a different example, um but let's let's do uh let's do cancer. So let's say we test uh 1,000 people uh for cancer. Let's say we're we're we're designing a new test, a new genetic test for cancer. So we're testing a thousand people uh for cancer, and let's say I have two groups. I've got a group that has the Cancer and a control group. So I have 500 people. So let's say I have uh 500 people that have cancer, and let's say I have 500 people that uh don't have cancer. Don't have cancer. Um, and then out of those groups, let's say of the people that have cancer, let's say 450 test positive and 50 test negative. So we're designing this test, and so we test it, and 450 test positive, 50 test negative. But let's say out of the control group who don't have cancer, there are some false positives. So let's say out of this one we actually have a 100 false positives, and 400 of them test negative. They should all test negative if it's a perfect test, but only 400 test negative. So this is just a scenario. Okay. And let's say that having cancer or not having cancer is event B, and let's say that the test result being positive or negative is event A. So I could compute the probability of A given uh event B. So first off, I can just compute the probability of A in this sample with this many people. Um, 550 people tested positive, so the probability of A in this sample is 55%. But the probability of A given that the person has cancer, so now we're zooming in to this population, is this 450 / 500. So that is uh I guess a 90%. So this is a 90% uh specific test, meaning that the probability of getting a positive test given that you actually had the thing you're testing for is 90%. Okay. So this is a way of computing this conditional probability. Good. Now really really important—most important part of this lecture—is you have to ask yourself what can you actually measure and what's the thing you actually want to be estimating. In this case, what I really want to do is I want to design a really good test, and then I want to use that test for people where I don't know if they do or don't have cancer. I'm trying to figure out the opposite. I'm trying to find out what is the probability of B given A. That is the thing that is actually hard to compute. I want to know what's the chance that I had cancer given that I have a positive test score score. And surprise surprise, it's not 100%. You could have a false positive. You might not have cancer and still test positive. So we want to be able to compute the probability of having the thing you're testing for given a positive test result. This is what's called an inverse problem. It's one of the most important uh uses of probability in statistics—is inferring something you want to know, like the outcome of a like like whether or not someone has a disease, from something you can actually measure, like the result of a test. So this is called um an inference, and usually we're going to use Bayes theorem uh for this inference problem. So these are called inference uh or inverse problems. This is an inverse an inverse problem. I want to know what's the probability of B given A. Maybe I know the probability of A given B, and I want to figure this out. So the next couple of lectures we're going to talk about how to derive Bayes theorem, how to use it to find uh kind of these inverse things that we want to know. Super super useful. Um, so stay tuned for that. Thank you.