In this video, we're going to see an incredibly powerful theorem in the context of probability called Bayes'Theorem. And Bayes'Theorem provides the basis for something called Bayesian inference, and is a really enormous deal that really changed how we think about probabilities and a lot of statistics in general. Now, I'm going to, in this video, just illustrate the very simplest example, and in the next video, we're going to jump it up to the sort of next level of difficulty. So...
The first thing I want to introduce is what actually is the theorem. Now, we have seen conditional probability already, so I am going to remind you that previously we've seen the following fact. That is, we've seen that the probability of A given B was the probability that A and B occurred, the intersection, divided out by the probability of B.
Now, I'm going to rearrange this, I'm going to go the other way around. So if I have this, I can also therefore look at what happens if I take the probability of B given A. So the same thing, but just flipped the other way around, and by comparing these two, it just has to be the probability, now it's B intersect A.
Note that that doesn't matter, A intersect B and B intersect A, I can flip those around, it doesn't make any difference. And then now it's all divided out by the probability of A. So we have these two different components and you'll notice that there's this portion, the numerator, that these two things are indeed going to be equal.
So I can take the 1, the bottom one, and I can substitute it into the top one. So what that's going to give me is that the probability of A given B is equal to, well, the probability of the intersection, but I'm going to rewrite that as the probability of B given A. multiplied by the probability of A, and then all divided out by the probability of B, as I have down in the bottom right here.
So, what I want you to note about this formula, this is going to be Bayes'theorem right here, this is what it is, at least in the single case where we've only got one B that we're interested in, and what we have here is that we can sort of alternate the a given b or b given a. We can change that rule around by multiplying by this particular ratio, the probability of a divided by the probability of b. Now the reason why this is so helpful is that sometimes computing the probability of a given b is easy, and sometimes the probability of b given a is easy.
Sometimes they're both easy, but in any scenario where one of those two is easy to compute, maybe you can go out in the real world and collect some data and figure it out, but that the other of the two is a little bit more challenging, you can use this formula to convert them. You can get from the one conditional probability to the other conditional probability that are related by Bayes'theorem. So let's look at an example we've seen before in the previous video, but we're going to investigate it in the context of this Bayes'theorem.
So the example was if you have a couple and they've got two different children and you're asserted that at least one of those children is going to be a girl, then what's the probability that both of the children are going to be a girl? So let's plug this into the formula. So I'm asking, in effect, I want to know what is the probability of the two girls given that we're going to have at least one girl. Well then... This, by the theorem, tells me that this is the probability, and I'm going to abbreviate even more and just go all the way down to 1 girl.
I mean at least 1 girl, but I'll just write 1g. Given that I have 2 girls, multiplied by P of A here. P of A is the first thing, so multiplied by the probability of 2 girls. And then finally divided out by the probability of B.
So this is the probability of at least 1 girl, which I've abbreviated to be the probability of 1g. Alright, so we have this computation, so how can we actually go and evaluate it now? Well, let's look at this conditional probability, the probability of having one girl, at least one girl, given that you know that there's two girls.
But, if you're being told that there's two girls, then the probability of having at least one girl is 100%. If you have two girls, you have at least one of them. So, the p of 1g given the 2g is really, really easy to compute. It's 100%, or it's just the value. of 1. I don't have to do anything.
Okay, well that was nice. What about the probability of there being 2 girls? Well, you might remember that the 4 cases are you could have a girl-girl, you could have a girl-boy, you could have a boy-girl, and you could have a boy-boy.
There were sort of 4 different sort of possibilities. But then, if we're going to investigate this, we want to investigate what's the probability of having 2 girls, well, there's only one of those 4 possibilities. So this is just going to be the value of a quarter. And then I divide out by the probability of at least one girl. Well, this one has a girl in it, that one has a girl in it, that one has a girl in it, there's three of them that have a girl, so three quarters.
In other words, we get one third, which is the same value that we computed just by pure conditional probability, but we verified that it works using Bayes'theorem that illustrates at least some motivation that Bayes'theorem is likely going to be true, and useful, presumably, in other contexts beyond this.