WEBVTT mathematics/probability/murray
00:00:00.000 --> 00:00:03.800
Hi, this is the probability lectures here on www.educator.com.
00:00:03.800 --> 00:00:09.000
My name is Will Murray and today, we are going to talk about Bayes’ rule.
00:00:09.000 --> 00:00:16.600
Bayes’ rule is one of the most interesting rules in probability but it is also the easiest to make mistakes with.
00:00:16.600 --> 00:00:20.800
You get these very counterintuitive results with base rule
00:00:20.800 --> 00:00:26.800
and you can get some very tricky problems that can really mess with your head.
00:00:26.800 --> 00:00:31.000
It is worth being very careful when you are dealing with Bayes’ rule.
00:00:31.000 --> 00:00:35.100
And it is also worth following the formula very carefully.
00:00:35.100 --> 00:00:42.500
If you follow the formula, you would not go wrong but you can also get some very strange stuff, if you are not careful.
00:00:42.500 --> 00:00:46.800
With that said, let me show you when you use Bayes’ rule.
00:00:46.800 --> 00:00:49.800
What kind of problem you apply it for.
00:00:49.800 --> 00:00:57.300
The idea is that your sample space, the set of all possible outcomes must be a disjoint union of events.
00:00:57.300 --> 00:01:01.700
Let me show you what that would look like.
00:01:01.700 --> 00:01:13.200
All the thing possible things that can happen have to be divided up into disjoint unions.
00:01:13.200 --> 00:01:18.000
You have to be covering all possibilities and they cannot overlap at all.
00:01:18.000 --> 00:01:26.500
Something like this, where you have an event B1, B2, and so on, up to Bn.
00:01:26.500 --> 00:01:32.600
You have a disjoint union, very common example of Bayes’ rule is when you have a group of people
00:01:32.600 --> 00:01:35.900
and some of them are women and some of them are men.
00:01:35.900 --> 00:01:38.100
That is a disjoint union, something like that.
00:01:38.100 --> 00:01:44.400
It could be a common example where you are going to see Bayes’ rule coming into play.
00:01:44.400 --> 00:01:50.500
After you have a disjoint union, you got one more event that overlaps all of them.
00:01:50.500 --> 00:01:56.800
You got one more event and I’m going to call it A, like this.
00:01:56.800 --> 00:02:02.000
This sort of overlaps into these different categories, this is A.
00:02:02.000 --> 00:02:08.000
The way Bayes’ rule is phrased or kind of question that you are going to get that
00:02:08.000 --> 00:02:14.000
for which Bayes’ rule gives you an answer is you know that A occur.
00:02:14.000 --> 00:02:23.100
You are given that A is true and then what is the probability that you are in one of the other of these B boxes.
00:02:23.100 --> 00:02:27.100
That is the kind of problem that you will see Bayes’ rule being applied to.
00:02:27.100 --> 00:02:31.200
I think after you work through some examples with me, you get the hang of it and
00:02:31.200 --> 00:02:35.400
you will get a feel for that this is the kind of problem that is asking me for Bayes’ rule.
00:02:35.400 --> 00:02:41.800
It always says, given that something happen, what is the probability that we are in one of these boxes?
00:02:41.800 --> 00:02:46.200
Let me give you the actual formula that you can use to solve Bayes’ rule problems and
00:02:46.200 --> 00:02:51.100
then we will see how it plays out in some examples.
00:02:51.100 --> 00:02:57.200
Let me start out wit Bayes’ rule for two choices and then I will move on to the general rule for N choices.
00:02:57.200 --> 00:03:00.100
Even the two choices, it looks a little daunting.
00:03:00.100 --> 00:03:11.400
The idea here is that we got our sample space divided into 2 disjoint events, which I will call B1 and B2.
00:03:11.400 --> 00:03:18.100
For example, it might be a man and women, and a group of people, B1 and B2.
00:03:18.100 --> 00:03:22.500
We got this overlapping event that kind of laps over both of them.
00:03:22.500 --> 00:03:28.600
We want a problems, we are going to study later on, we are going to have tennis players at a college.
00:03:28.600 --> 00:03:32.400
There are some of that everybody at the college is either a man or woman and
00:03:32.400 --> 00:03:37.400
some of the men play tennis and some of the women play tennis.
00:03:37.400 --> 00:03:41.000
We will have this event that overlaps into both categories.
00:03:41.000 --> 00:03:45.900
And then the question is, if you know that that event is true.
00:03:45.900 --> 00:03:50.600
In the problem later on, if you know that a person plays tennis,
00:03:50.600 --> 00:03:54.500
what is the probability that you are in one of the other of the categories?
00:03:54.500 --> 00:03:57.500
I just solved it for B1 here.
00:03:57.500 --> 00:04:00.800
The probability of B1 given A.
00:04:00.800 --> 00:04:05.000
You have this fairly complicated formula to calculate it.
00:04:05.000 --> 00:04:09.600
What it does is it reverses the roles of the A and B1.
00:04:09.600 --> 00:04:17.600
We see we got B1 given A here and then you reverse that to have A given B1 × the probability of B1.
00:04:17.600 --> 00:04:23.100
In the bottom, we have the same thing again, probability of A given B1 × the probability of B1.
00:04:23.100 --> 00:04:30.000
And the same thing would be too, the probability of A given B2 × the probability of B2.
00:04:30.000 --> 00:04:32.700
That is a fairly complicated formula.
00:04:32.700 --> 00:04:36.000
After we do some examples, I think you will get more used to it.
00:04:36.000 --> 00:04:40.500
Bear with me, I’m going to give you the formula for N possible choices.
00:04:40.500 --> 00:04:44.900
Instead of B1 and B2, we will have B1 through BN.
00:04:44.900 --> 00:04:47.900
I will give you that formula and then we will jump into some examples.
00:04:47.900 --> 00:04:52.300
But if you are already feeling overwhelmed, if you want to try an example right away,
00:04:52.300 --> 00:04:58.100
you might want to go ahead and skip to example 1 because that is one where you have two choices.
00:04:58.100 --> 00:05:03.900
That is where we will use this formula right away.
00:05:03.900 --> 00:05:06.400
Let me show you Bayes’ rule for multiple choices.
00:05:06.400 --> 00:05:14.900
It is the same general rule as Bayes’ rule for two choices but it applies to a more complicated setting here.
00:05:14.900 --> 00:05:26.500
We have a big sample space and it is divided up as a disjoint union of several different possibilities.
00:05:26.500 --> 00:05:36.100
We are calling the different possibilities B1, B2, and so on, up to Bn.
00:05:36.100 --> 00:05:48.500
The idea there is that at some point, you are interested in the probability of one of these choices which I’m going to call B sub J.
00:05:48.500 --> 00:05:56.200
What you are given is some information about one more event which will the overlap all of these choices.
00:05:56.200 --> 00:05:59.800
There is an A that overlaps all of these choices.
00:05:59.800 --> 00:06:03.100
You are told that A is true.
00:06:03.100 --> 00:06:06.700
You are given that A is true, this is conditional probability here.
00:06:06.700 --> 00:06:15.500
The probability of B sub J given A is equal to, this is the same as the Bayes’ rule for two choices in the numerator.
00:06:15.500 --> 00:06:18.000
We switched the rules of the B sub J and A.
00:06:18.000 --> 00:06:23.800
The probability of A given B sub J × the probability of B sub J.
00:06:23.800 --> 00:06:32.300
And then in the denominator, we have the same kind of thing except we are adding up all those possibilities over all those events.
00:06:32.300 --> 00:06:38.100
The probability of A given B sub I × the probability of B sub I.
00:06:38.100 --> 00:06:42.200
You add that up over all the I's from 1 to N.
00:06:42.200 --> 00:06:45.200
Let us check that out in the context of some examples.
00:06:45.200 --> 00:06:51.000
The first one is just only two possibilities but I think it is already fairly challenging.
00:06:51.000 --> 00:06:56.300
We will get the hang of it, probably out after we do several examples together.
00:06:56.300 --> 00:07:02.600
Example 1, it is a problem having to do with a home test for diabetes.
00:07:02.600 --> 00:07:11.100
Imagine, you buy this little kit at the pharmacy and you take it home and you test yourself for diabetes.
00:07:11.100 --> 00:07:16.900
The setup here is that among all the people who take these tests, 20% of them actually are diabetic.
00:07:16.900 --> 00:07:21.900
Maybe the people who take these has some reason to suspect that they might be diabetic.
00:07:21.900 --> 00:07:24.100
20% of them actually are diabetic.
00:07:24.100 --> 00:07:26.600
Now, these tests are not 100% accurate.
00:07:26.600 --> 00:07:30.700
Sometimes they have false positives and sometimes they have false negatives.
00:07:30.700 --> 00:07:40.600
The way it works is, if the person taking the test, if you are diabetic then there is a 90% chance that the test will show positive.
00:07:40.600 --> 00:07:46.700
If you are not diabetic then there is an 80% chance that the test will show negative.
00:07:46.700 --> 00:07:50.500
It looks like the test is sort of 90% accurate, if you diabetic.
00:07:50.500 --> 00:07:54.100
It is 80% accurate, if you are not diabetic.
00:07:54.100 --> 00:08:00.100
The idea here is that a woman takes the test and it shows positive.
00:08:00.100 --> 00:08:07.600
It shows positive and then the question is what is the chance that she actually is diabetic?
00:08:07.600 --> 00:08:09.400
It is a fairly complicated problem.
00:08:09.400 --> 00:08:14.300
Let me try to graph out the possibilities here, I’m going to label some events.
00:08:14.300 --> 00:08:24.800
Our disjoint events are the fact that when you take the test, you either are diabetic or not diabetic.
00:08:24.800 --> 00:08:27.000
I'm going to call those the B1 and B2.
00:08:27.000 --> 00:08:35.000
B1 is the event that you are diabetic, that you have the disease.
00:08:35.000 --> 00:08:43.800
B2 is the event that you are not diabetic.
00:08:43.800 --> 00:08:50.700
What we are given in this scenario is that a woman takes the test and it shows positive.
00:08:50.700 --> 00:08:54.000
The test came a positive for this particular woman.
00:08:54.000 --> 00:09:04.700
And that is what I'm going to call the event A, is that the test is positive.
00:09:04.700 --> 00:09:07.500
Let me draw out how these events all fit together.
00:09:07.500 --> 00:09:13.000
Because as I said, it is a little complicated.
00:09:13.000 --> 00:09:22.000
Here is our total sample space and there are two things that can happen.
00:09:22.000 --> 00:09:24.800
Either the woman is diabetic or not diabetic.
00:09:24.800 --> 00:09:26.800
That gives us a disjoint union.
00:09:26.800 --> 00:09:43.900
B1 is diabetic and B2 is that she is not diabetic.
00:09:43.900 --> 00:09:52.400
She takes this test, we do not know which of the category she is in.
00:09:52.400 --> 00:09:57.100
She takes the test and she shows up positive.
00:09:57.100 --> 00:09:59.900
The test registers that she is positive.
00:09:59.900 --> 00:10:09.200
The question is given the she shows positive on the test, what is the probability that she is actually diabetic.
00:10:09.200 --> 00:10:18.000
In other words, we want to find the probability that she is actually diabetic.
00:10:18.000 --> 00:10:24.600
The probability that B1 is true given that the test shows her as being positive.
00:10:24.600 --> 00:10:28.500
We want to find the probability of B1 given A.
00:10:28.500 --> 00:10:31.300
That is a classic Bayes’ rule scenario.
00:10:31.300 --> 00:10:35.700
Once we phrased it in this form, it is fairly easy to apply the formula.
00:10:35.700 --> 00:10:37.900
I will do that on the next slide.
00:10:37.900 --> 00:10:43.900
Let me make sure that you understand the setup, before we move on to the next slide and apply the formula.
00:10:43.900 --> 00:10:48.900
I think the setup is the trickiest part of this formula.
00:10:48.900 --> 00:10:54.900
The idea here is we are setting up two events, diabetic and not diabetic.
00:10:54.900 --> 00:10:58.400
Those gives us a disjoint union of all the people in the world.
00:10:58.400 --> 00:11:01.500
Everybody in the world is either diabetic or not diabetic.
00:11:01.500 --> 00:11:05.900
At least according to this simplified scenario.
00:11:05.900 --> 00:11:08.300
We have this event that kind of overlaps both of them.
00:11:08.300 --> 00:11:16.500
The test is positive, we are given that the woman has taken the test and the test is registered positive.
00:11:16.500 --> 00:11:23.100
because the test has registered positive, she could still be diabetic or not diabetic.
00:11:23.100 --> 00:11:29.100
I want to find the probability that she actually is diabetic given that the test has registers positive.
00:11:29.100 --> 00:11:32.800
we are going to calculate that using Bayes’ rule on the next slide.
00:11:32.800 --> 00:11:37.000
Let me expand this formula on this side.
00:11:37.000 --> 00:11:46.100
We want to find the probability that she is diabetic given that the test has registered positive.
00:11:46.100 --> 00:11:50.200
I'm just going to expand that out using Bayes’ rule for two events.
00:11:50.200 --> 00:11:54.900
I gave you this formula a couple slides ago.
00:11:54.900 --> 00:11:58.200
You can check out this formula, if it does not look familiar.
00:11:58.200 --> 00:12:02.600
It is the probability, we will switch the rules of A and B1.
00:12:02.600 --> 00:12:10.800
A given B1 × the probability of B1 divided by, the denominator is the same thing,
00:12:10.800 --> 00:12:29.300
A given B1 × the probability of B1 + the same thing for B2, the probability of A given B2 × the probability of B2.
00:12:29.300 --> 00:12:35.900
Let us try to fill in all of these probabilities because we can read them off from the stem of the problem.
00:12:35.900 --> 00:12:43.000
If you remember, first of all, let me remind you of what these are.
00:12:43.000 --> 00:12:49.100
B1 is the event that somebody is diabetic.
00:12:49.100 --> 00:12:57.600
B2 is the event that somebody is not diabetic.
00:12:57.600 --> 00:13:03.100
A is the event that somebody who takes the test shows up positive.
00:13:03.100 --> 00:13:09.200
And we were told in the stem of the problem, you can go back and check,
00:13:09.200 --> 00:13:16.900
that 20% of the people who take this test actually are diabetic.
00:13:16.900 --> 00:13:19.600
That is the probability of B1, that is 20%.
00:13:19.600 --> 00:13:23.200
I will just write that as 0.2.
00:13:23.200 --> 00:13:26.800
You can fill that in 0.2.
00:13:26.800 --> 00:13:29.300
That means 80% of them are not diabetics.
00:13:29.300 --> 00:13:32.600
I will fill in a 0.8 there.
00:13:32.600 --> 00:13:37.800
We are also given something about the accuracy of the test.
00:13:37.800 --> 00:13:44.200
The test is 90% accurate, when a person is diabetic.
00:13:44.200 --> 00:13:52.700
That means that if the person is diabetic, the probability that the test will be positive is 90%.
00:13:52.700 --> 00:13:55.700
That tells us the probability of A given B1.
00:13:55.700 --> 00:14:00.800
Given that the person is diabetic, the probability that the test will show up positive is 90%.
00:14:00.800 --> 00:14:07.400
I can put that in for A given B1.
00:14:07.400 --> 00:14:14.800
The last part is a little confusing here because we want to find the probability of A given B2.
00:14:14.800 --> 00:14:22.200
That is the probability that the test is positive given that the person is not diabetic.
00:14:22.200 --> 00:14:32.400
What the problem told us was that if the person is not diabetic, the test is accurate 80% of the time.
00:14:32.400 --> 00:14:39.500
What that means is the test will show negative because that is the accurate result for a non diabetic person.
00:14:39.500 --> 00:14:43.100
The test will show negative 80% of the time.
00:14:43.100 --> 00:14:48.100
That means the test will show positive 20% of the time.
00:14:48.100 --> 00:14:53.600
The probability of A given B2 is 20 percent.
00:14:53.600 --> 00:15:08.300
That is really because the probability that the test is positive given that the subject is a not diabetic.
00:15:08.300 --> 00:15:13.100
Given that the subject is not diabetic, that is the trickiest one there.
00:15:13.100 --> 00:15:17.800
Remember, when we said if it is not diabetic, the test is 80% going to show negative.
00:15:17.800 --> 00:15:22.200
That means it is 20% going to show positive.
00:15:22.200 --> 00:15:24.700
That is filling in all the numbers, that is the hard part.
00:15:24.700 --> 00:15:29.600
Now, it is just a matter of simplifying all these numbers down.
00:15:29.600 --> 00:15:34.900
I’m going to write them on the next line, just to get rid of all the jargon.
00:15:34.900 --> 00:15:46.100
0.9 × 0.20/0.9 × 0.20 + 0.8 × 0.20.
00:15:46.100 --> 00:15:47.400
I will switch the roles there.
00:15:47.400 --> 00:15:53.400
I see I got a 0.2 multiplied by everything and I can just cancel out the 0.2 from everything,
00:15:53.400 --> 00:15:55.400
dividing by 0.2 from the top and bottom.
00:15:55.400 --> 00:15:58.100
I still see that I got these decimals everywhere.
00:15:58.100 --> 00:16:02.500
You will multiply by 10/10 and I will just get rid of some of my decimals.
00:16:02.500 --> 00:16:06.400
That will give you 9/9 + 8.
00:16:06.400 --> 00:16:12.200
That is pretty easy to figure out, it is 9/17.
00:16:12.200 --> 00:16:24.300
That is our final answer, that is the probability that a woman actually has diabetes if this test shows that she is positive,
00:16:24.300 --> 00:16:26.500
if the test shows positive for diabetes.
00:16:26.500 --> 00:16:34.200
That is a little surprising because if you think about it 9/17 is pretty close to ½.
00:16:34.200 --> 00:16:40.200
We said that this test seems to be accurate, 80% of the time if she is not diabetic.
00:16:40.200 --> 00:16:43.500
It is accurate 90% of the time if she is diabetic.
00:16:43.500 --> 00:16:51.500
And yet, when she gets a positive reading, it is only about a ½ chance that she does in fact have diabetes.
00:16:51.500 --> 00:17:01.400
That is a little surprising and that is really why Bayes’ rule can lead you into some of these very counterintuitive results.
00:17:01.400 --> 00:17:07.800
Essentially, that is a result of the fact that not many of the subjects in the world are diabetic.
00:17:07.800 --> 00:17:12.400
It skews the numbers to one side but it is a little surprising because
00:17:12.400 --> 00:17:20.700
if you think the test is 80% accurate on one side of the ledger and it is 90% accurate on another side of the ledger,
00:17:20.700 --> 00:17:30.000
how come it turns out to be accurate about ½ the time, when it shows a positive result.
00:17:30.000 --> 00:17:35.300
That is the way it works out and that is why you really have to trust the math in Bayes’ rule
00:17:35.300 --> 00:17:40.800
and the intuition is sometimes completely wrong.
00:17:40.800 --> 00:17:44.400
Let me just remind you where we got everything here.
00:17:44.400 --> 00:17:50.100
I just wrote the formula for Bayes’ rule here for two events.
00:17:50.100 --> 00:17:52.900
When we have a union of two events, that is the formula for Bayes’ rule.
00:17:52.900 --> 00:17:58.100
I got that from the second slide of this lecture series.
00:17:58.100 --> 00:18:04.200
You can just play it back and to find that formula earlier on in the video.
00:18:04.200 --> 00:18:08.000
And then I was filling in all these probabilities.
00:18:08.000 --> 00:18:12.700
B1 and B2 are the probabilities that someone is diabetic and not diabetic.
00:18:12.700 --> 00:18:15.700
For this population, that is a 0.2 and 0.8.
00:18:15.700 --> 00:18:19.300
That is why I got those numbers.
00:18:19.300 --> 00:18:27.000
The 0.9 comes from the probability that the test will be positive given that the person is diabetic.
00:18:27.000 --> 00:18:29.200
That came from the problem stem.
00:18:29.200 --> 00:18:35.500
It said that if a person is diabetic then there is a 90% chance that the test will show positive.
00:18:35.500 --> 00:18:41.100
This 0.2 is the most confusing part, it says that what is the probability of A given B2,
00:18:41.100 --> 00:18:47.100
the probability that the test shows positive given that the person is not diabetic.
00:18:47.100 --> 00:18:52.400
That is the probability that the test is inaccurate.
00:18:52.400 --> 00:18:57.900
We said that the person is not diabetic, the test has an 80% chance of being accurate.
00:18:57.900 --> 00:19:01.200
It has a 20% chance of being inaccurate.
00:19:01.200 --> 00:19:03.100
That is where that 0.2 comes from.
00:19:03.100 --> 00:19:11.100
Once you drop all the numbers in, it is a pretty simple matter to simplify the fractions down to 9/17,
00:19:11.100 --> 00:19:13.800
which of course is approximately ½.
00:19:13.800 --> 00:19:21.000
You get this surprisingly low number, when you look at all the numbers in the original problem.
00:19:21.000 --> 00:19:25.700
That is Bayes’ rule for two outcomes there.
00:19:25.700 --> 00:19:29.300
Let us go ahead and try another example.
00:19:29.300 --> 00:19:36.100
In this example, we are visiting a small college and it has 220 women and 115 men.
00:19:36.100 --> 00:19:38.100
Tennis seems to be very popular at this college.
00:19:38.100 --> 00:19:43.300
40% of the women play tennis and 30% of the men play tennis.
00:19:43.300 --> 00:19:46.300
The idea here is that you find an extra tennis racket.
00:19:46.300 --> 00:19:50.500
You know it belongs to somebody who left a tennis racket lying around.
00:19:50.500 --> 00:19:52.900
It must be one of these tennis players.
00:19:52.900 --> 00:19:59.500
You want to find out what is the chance that this tennis racket belongs to a woman?
00:19:59.500 --> 00:20:07.000
Let me setup some events here and we will use Bayes’ rule to calculate things out.
00:20:07.000 --> 00:20:19.300
I'm going to say A is the event that we have a tennis player because that is the event that we are given.
00:20:19.300 --> 00:20:21.300
We are given that we found a tennis racket.
00:20:21.300 --> 00:20:23.800
We know somebody plays tennis.
00:20:23.800 --> 00:20:33.700
B1 and B2 are going to be the sets of women and men respectively.
00:20:33.700 --> 00:20:42.000
And those give us a disjoint union of all the students at this college.
00:20:42.000 --> 00:20:48.300
Let me draw a map of all the students at this college.
00:20:48.300 --> 00:20:52.700
You are all the students at this college and I guess there are few more women than men.
00:20:52.700 --> 00:20:57.700
I will try to draw this somewhat to scale.
00:20:57.700 --> 00:21:11.700
There is B1 which is women and there is B2, the set of all the men at this college.
00:21:11.700 --> 00:21:18.900
Overlapping both of those is the set of tennis players at this college.
00:21:18.900 --> 00:21:26.600
The woman and man of course do not overlap each other but the tennis players overlap both
00:21:26.600 --> 00:21:32.100
because some of the women play tennis and some of the men play tennis.
00:21:32.100 --> 00:21:38.700
Here is the set of tennis players and what we are given is that we have found the tennis rackets.
00:21:38.700 --> 00:21:46.100
We found something belonging to a tennis player and we have to figure out what is the chance that it belongs to a woman.
00:21:46.100 --> 00:21:57.900
We are trying to find the probability that we are looking for a woman given that the person we are looking for is a tennis player.
00:21:57.900 --> 00:22:01.000
That is the probability of B1 given A.
00:22:01.000 --> 00:22:04.600
We have a nice formula for that, straight from Bayes’ rule.
00:22:04.600 --> 00:22:12.500
I'm just going to copy the formula directly from the second slide of this lecture.
00:22:12.500 --> 00:22:21.300
Remember, that you switched the A and B1 and then you multiply that × the probability of B1.
00:22:21.300 --> 00:22:29.100
You divide that by the same thing P of A given B1 × P of B1.
00:22:29.100 --> 00:22:37.900
Then, you add on the same thing with P of B2.
00:22:37.900 --> 00:22:41.700
We want to fill in all those probabilities.
00:22:41.700 --> 00:22:45.600
All those probabilities had been given to us in the problem.
00:22:45.600 --> 00:22:48.600
If we fill them in right, this will be fairly fast.
00:22:48.600 --> 00:22:56.300
The probability of A given B1, that means the probability that somebody plays tennis given that they are a woman.
00:22:56.300 --> 00:23:02.600
We find that right here, 40% of the women play tennis, that is 0.4.
00:23:02.600 --> 00:23:07.100
What is the probability that someone is a woman?
00:23:07.100 --> 00:23:23.300
Here, we have 220 women and 115 men, there are as 370 students total at this college and 220 of them are women.
00:23:23.300 --> 00:23:28.000
The probability of getting a woman is 22 out of 37.
00:23:28.000 --> 00:23:32.100
It is actually 220 out of 370 but I’m just simplifying that down.
00:23:32.100 --> 00:23:35.700
In the denominator here, the first two terms are the same.
00:23:35.700 --> 00:23:40.900
0.4 × 22 out of 37.
00:23:40.900 --> 00:23:48.600
Now, the probability of A given B2 of the probability that we have a tennis player given that we have a man.
00:23:48.600 --> 00:23:56.300
Only 30% of the men at this college play tennis, 0.3.
00:23:56.300 --> 00:23:59.900
If you have a man, there is a 30% chance that he is a tennis player.
00:23:59.900 --> 00:24:05.100
The probability that you have a man in the first place is 150/370.
00:24:05.100 --> 00:24:09.800
I will just go ahead and reduce that to 15/37.
00:24:09.800 --> 00:24:11.500
That is probably the trickiest part now.
00:24:11.500 --> 00:24:17.500
We just have to simplify these fractions here.
00:24:17.500 --> 00:24:22.500
I can multiply by 37/37 and I will simplify things a bit.
00:24:22.500 --> 00:24:39.500
We get 0.4 × 22/0.4 × 22 × 22 + 0.3 × 15.
00:24:39.500 --> 00:24:41.700
I have canceled all my denominators of 37.
00:24:41.700 --> 00:24:48.300
And this is not one I think that simplifies in any terribly nice way.
00:24:48.300 --> 00:24:53.000
I just went ahead and calculated it out to a decimal.
00:24:53.000 --> 00:25:07.100
What I calculated was 0.662 is my probability that this tennis racket that I found, it belongs to a woman.
00:25:07.100 --> 00:25:17.500
About a 66% chance that when we go to the lost and found, that will be a woman coming to claim that tennis racket.
00:25:17.500 --> 00:25:20.500
Let me remind you the setup here.
00:25:20.500 --> 00:25:26.600
I think the hardest part about Bayes’ rule problems is kinda setting everything up, identifying the events,
00:25:26.600 --> 00:25:29.900
and getting yourself ready to go with that formula.
00:25:29.900 --> 00:25:36.500
Once you get the formula, you fill in all the probabilities and then you reduce the fractions.
00:25:36.500 --> 00:25:40.900
The setup here is to, first of all divide our world into women and men.
00:25:40.900 --> 00:25:44.500
We got two disjoint events that cover the whole world.
00:25:44.500 --> 00:25:47.300
We got women here and men.
00:25:47.300 --> 00:25:54.700
And then, we have this third event, the group of tennis players.
00:25:54.700 --> 00:25:57.400
This overlap into women and men.
00:25:57.400 --> 00:26:01.100
There are some women tennis players and there are some men tennis players.
00:26:01.100 --> 00:26:08.200
We set up our events here and the problem is to tell us given that we have a tennis player,
00:26:08.200 --> 00:26:11.500
because we found a tennis racket and it must belong to a tennis player.
00:26:11.500 --> 00:26:16.200
Given that we have a tennis player, what is the probability that it belongs to a woman?
00:26:16.200 --> 00:26:20.600
What is the probability of B1 given that we are in A?
00:26:20.600 --> 00:26:27.200
Once you identify it that way, it is fairly easy after that to expand it out using Bayes’ rule
00:26:27.200 --> 00:26:30.500
because now you are just putting a formula.
00:26:30.500 --> 00:26:38.200
That expands out into this formula, I just copy that straight off the second slide of this lecture.
00:26:38.200 --> 00:26:40.700
Then, I filled in all the probabilities.
00:26:40.700 --> 00:26:46.700
The probability of A given B1 means that if you are a woman, what is the probability that you play tennis?
00:26:46.700 --> 00:26:50.000
That comes from this 40% right here.
00:26:50.000 --> 00:26:54.300
That is where that 0.4 came from and that 0.4.
00:26:54.300 --> 00:26:59.700
Then, probability that a man plays tennis is 0.3.
00:26:59.700 --> 00:27:08.500
Just the overall probabilities of B1 and B2, that comes from the total number of women and men
00:27:08.500 --> 00:27:18.400
at the university not worrying about tennis right now is 220/370 for women and 15/370 for men.
00:27:18.400 --> 00:27:23.800
I just simplify down the calculations and I came up with the decimal which was equivalent
00:27:23.800 --> 00:27:33.400
to about 66% chance that this tennis racket must belong to a woman.
00:27:33.400 --> 00:27:39.500
In example 3 here, we got the state of New Alkenya.
00:27:39.500 --> 00:27:42.500
We are looking at the voting trends in this state.
00:27:42.500 --> 00:27:49.900
Apparently, 40% of the voters there are democrats and 50% are republicans, and the leftover 10% are all freemasons.
00:27:49.900 --> 00:27:52.700
This new party of freemasons.
00:27:52.700 --> 00:28:00.100
We are surveying how many people support freeway lanes for pogo sticks?
00:28:00.100 --> 00:28:04.000
How many supports giving us a dedicated lane on the freeway for pogo sticks?
00:28:04.000 --> 00:28:07.300
24% of the democrats are in favor of that idea.
00:28:07.300 --> 00:28:10.000
30% of republicans think that is a good idea.
00:28:10.000 --> 00:28:13.900
50% of the freemasons are in favor of that.
00:28:13.900 --> 00:28:18.300
What we found is that a voter, we have done a telephone survey.
00:28:18.300 --> 00:28:19.400
We grab a voter at random.
00:28:19.400 --> 00:28:24.100
It turns out that this voter is strongly in favor of the freeway lanes for the pogo sticks.
00:28:24.100 --> 00:28:30.400
The question is what is the probability that this particular voter is a democrat?
00:28:30.400 --> 00:28:34.000
Let me setup some events here.
00:28:34.000 --> 00:28:42.000
We are going to divide the world now into democrats and republicans, and freemasons.
00:28:42.000 --> 00:28:50.200
Those are going to be, my B1 and B2 and B3.
00:28:50.200 --> 00:29:02.300
B1, I will call it BD is the set of democrats.
00:29:02.300 --> 00:29:09.500
B2 will be the set of republicans, I will call that BR, republicans.
00:29:09.500 --> 00:29:19.400
B3 will be the set of freemasons, I will call that B sub F.
00:29:19.400 --> 00:29:29.000
The event that overlaps into all three of those categories is the fact that at random,
00:29:29.000 --> 00:29:36.500
likes the idea of dedicated freeway lanes for pogo sticks.
00:29:36.500 --> 00:29:40.900
Event A would be a pogo stick supporter there.
00:29:40.900 --> 00:29:45.800
Let me indicate how these events all fit together.
00:29:45.800 --> 00:29:50.000
Let me draw you a map of all of these voters.
00:29:50.000 --> 00:29:56.300
There is no overlap between democrats and republicans and freemasons.
00:29:56.300 --> 00:30:03.200
Those really are three completely separate categories there.
00:30:03.200 --> 00:30:06.700
I put the democrats on the left.
00:30:06.700 --> 00:30:10.000
It is appropriate to their political persuasion.
00:30:10.000 --> 00:30:12.800
There is B, the democrats.
00:30:12.800 --> 00:30:20.000
I will put the republicans over here, the republicans.
00:30:20.000 --> 00:30:23.500
And then we have the freemasons.
00:30:23.500 --> 00:30:36.500
Overlapping all three of those is the set of people who support freeway lanes for pogo sticks.
00:30:36.500 --> 00:30:41.700
There is the set of people who like freeway lanes for pogo sticks and some democrats like that idea and
00:30:41.700 --> 00:30:46.900
some republicans think it is a good idea and some freemasons think it is a good idea.
00:30:46.900 --> 00:30:56.500
What we are really trying to calculate here is the probability that a random voter is a democrat.
00:30:56.500 --> 00:31:05.600
The probability of BD, but we are given that that person supports the freeway lanes for the pogo sticks.
00:31:05.600 --> 00:31:12.500
Given that A is true, that is what we want to calculate.
00:31:12.500 --> 00:31:15.200
I want to expand that out on the next page.
00:31:15.200 --> 00:31:18.000
We are going to use our formula for Bayes’ rule but
00:31:18.000 --> 00:31:22.700
I think probably the trickiest part of this problem has already been done on this page.
00:31:22.700 --> 00:31:27.400
On the next page it is just expanding a formula and then doing some arithmetic.
00:31:27.400 --> 00:31:30.100
The key steps are really here on this page.
00:31:30.100 --> 00:31:34.000
It is identifying the three events here, democrats, republicans, and freemasons.
00:31:34.000 --> 00:31:38.100
Those give us a disjoint union of the space of all voters.
00:31:38.100 --> 00:31:46.600
And then, we have this one overlapping event which is that a voter could support freeway lanes for pogo sticks.
00:31:46.600 --> 00:31:51.900
That one event which we are calling A, overlaps all three of those.
00:31:51.900 --> 00:31:55.700
We are given that we found the voter who does support those lanes.
00:31:55.700 --> 00:32:01.000
The question is, what is the probability that our voter is a democrat?
00:32:01.000 --> 00:32:08.900
We are going to expand this out on the next page using the Bayes’ rule for multiple events.
00:32:08.900 --> 00:32:13.100
Let us work that out on this page.
00:32:13.100 --> 00:32:15.800
Let me remind you what we are trying to calculate.
00:32:15.800 --> 00:32:25.700
We are trying to calculate the probability that a voter is a democrat given that she supports freeway lanes for pogo sticks.
00:32:25.700 --> 00:32:34.500
I'm going to write-down the Bayes’ rule formula which was that, let me write that generically over here in the corner.
00:32:34.500 --> 00:32:43.400
The probability of b sub J given A is the numerator, you switch them.
00:32:43.400 --> 00:32:48.600
Probability of A given B sub J × the probability of B sub J.
00:32:48.600 --> 00:32:53.300
I’m just copying this from that third slide back in the game.
00:32:53.300 --> 00:32:55.200
You can see where this formula comes from.
00:32:55.200 --> 00:33:17.200
Divided by the sum from, as I goes from 1 to N, the same things probability of A given B sub I × the probability of B sub I.
00:33:17.200 --> 00:33:18.600
We are going to expand that out.
00:33:18.600 --> 00:33:19.900
Here, we have three events.
00:33:19.900 --> 00:33:26.800
We have someone being a democrat, we have someone being a republican,
00:33:26.800 --> 00:33:31.000
and the probability of someone being a freemason.
00:33:31.000 --> 00:33:35.700
And then of course, we have the pogo sticks overlapping all of them, that is the A.
00:33:35.700 --> 00:33:39.300
A is the pogo stick crowd.
00:33:39.300 --> 00:33:49.800
But according to our formula here, in the numerator, we have the probability and
00:33:49.800 --> 00:33:57.700
we switched them A given B sub D × the probability of B sub D.
00:33:57.700 --> 00:34:03.500
The D is like the J in our formula before, B sub D.
00:34:03.500 --> 00:34:07.600
Our numerator is going to be quite long because we are adding up three different things.
00:34:07.600 --> 00:34:23.900
The probability of A given B sub D × the probability of B sub D + the probability of A given B sub R ×
00:34:23.900 --> 00:34:38.200
the probability of B sub R + the probability of A given B sub F × the probability of B sub F.
00:34:38.200 --> 00:34:40.900
That is probably the hard work done now.
00:34:40.900 --> 00:34:46.400
We are just going to fill in all of these probabilities.
00:34:46.400 --> 00:34:58.500
The probability of A given B sub B that means if somebody is a democrat, what is the probability that they support the pogo sticks.
00:34:58.500 --> 00:35:08.200
From the original stem of the problem, we were given that if somebody is a democrat
00:35:08.200 --> 00:35:14.200
then there is a 20% chance, I will put 0.20 that they support the lanes.
00:35:14.200 --> 00:35:23.600
The probability of being a democrat in the first place is 40%, 0.4 is the probability of B sub D.
00:35:23.600 --> 00:35:30.500
The first set of terms on the denominator is just the same, 0.2 × 0.4.
00:35:30.500 --> 00:35:38.400
Now, the probability that a republicans supports these freeway lanes is, let us see.
00:35:38.400 --> 00:35:44.500
The survey said that 30% of the republican support these pogo sticks.
00:35:44.500 --> 00:35:49.200
The probability of being a republican is 0.5, in the first place.
00:35:49.200 --> 00:35:53.900
That is because 50% of the voters are republicans, in the first place.
00:35:53.900 --> 00:35:58.500
The probability that a freemasons supports the lanes is 0.5.
00:35:58.500 --> 00:36:02.400
Given that you are a freemason, there is a 50% chance that you support the lanes.
00:36:02.400 --> 00:36:11.500
The probability that you are a freemason in the first place is 0.1 because 10% of the voters are freemasons.
00:36:11.500 --> 00:36:16.700
It is a fairly quick process to simplify this.
00:36:16.700 --> 00:36:20.600
In fact, I think I see I have a lot of decimals.
00:36:20.600 --> 00:36:28.500
You know what I'm going to do is multiply top and bottom by 100 and that will get rid of all my decimals for me,
00:36:28.500 --> 00:36:30.200
because I have decimals everywhere here.
00:36:30.200 --> 00:36:35.100
I have 2 × 4, that is not 2.4 that is 2 × 4.
00:36:35.100 --> 00:36:43.700
2 × 4 + 3 × 5 + 5 × 1.
00:36:43.700 --> 00:36:45.600
That is going to simplify pretty easily now.
00:36:45.600 --> 00:37:00.200
That gives me 8/8 + 15 + 5 which is 8/28, which is 2/7.
00:37:00.200 --> 00:37:08.500
That is our probability that a random pogo stick supporting voter is a democrat.
00:37:08.500 --> 00:37:09.800
That is our answer there.
00:37:09.800 --> 00:37:13.700
Let me remind you how we got to each of the steps there.
00:37:13.700 --> 00:37:18.400
First of all, I was recalling the Bayes’ rule formula for multiple events.
00:37:18.400 --> 00:37:25.500
This formula is copied straight off the third slide of this lecture, if you go back and check, you will find it.
00:37:25.500 --> 00:37:28.000
That is the Bayes’ rule formula for multiple events.
00:37:28.000 --> 00:37:35.700
In this case, my disjoint events are being a democrat, being a republican, and being a freemason.
00:37:35.700 --> 00:37:39.300
The one that overlaps them all is supporting these pogo sticks.
00:37:39.300 --> 00:37:41.500
That was our A here.
00:37:41.500 --> 00:37:47.100
The question is what is the chance that you are a democrat given that you support these pogo sticks?
00:37:47.100 --> 00:38:00.300
According to Bayes’ rule, we can expand that out and we sort of switch the A and B sub D here × the probability of B sub D.
00:38:00.300 --> 00:38:03.600
We have this big sum in the denominator.
00:38:03.600 --> 00:38:12.900
A given B sub D × B sub D, A given B sub R × B sub R, and A given B sub F × B sub F.
00:38:12.900 --> 00:38:18.400
If we plug in all the probabilities, I got all of these probabilities from the stem of the problem.
00:38:18.400 --> 00:38:29.400
It tells me, first of all that 40% of people are democrats, 50% of people are republicans and 10% of people are freemasons.
00:38:29.400 --> 00:38:37.400
It also told me that given that you are a democrat, there is a 20% chance that you support the lanes, the pogo sticks.
00:38:37.400 --> 00:38:41.500
Given that you are a republican, there is a 30% chance that you support them.
00:38:41.500 --> 00:38:46.200
Given that you are a freemason, there is a 50% chance that you support them.
00:38:46.200 --> 00:38:47.900
And then, I just did a little arithmetic.
00:38:47.900 --> 00:38:55.800
I did not like these decimal so I multiply top and bottom by 100 which gave me a 10 here to turn 0.21 to 2.
00:38:55.800 --> 00:38:59.100
A 10 to spare here to turn that 0.4 to a 4.
00:38:59.100 --> 00:39:03.500
I got 2 × 4, 2 × 4, 3 × 5, 5 × 1.
00:39:03.500 --> 00:39:13.700
That simplify down nicely into the fraction 2/7.
00:39:13.700 --> 00:39:17.600
Example 4 is a real classic of probability.
00:39:17.600 --> 00:39:21.200
This is a famous paradox in probability.
00:39:21.200 --> 00:39:25.600
It is one that a lot of people get very confused about.
00:39:25.600 --> 00:39:27.800
It is going to be fun to work through it.
00:39:27.800 --> 00:39:31.900
It is a Bayes’ rule problem, the idea is that we have three bags.
00:39:31.900 --> 00:39:37.700
One bag has 2 apples, one with 2 oranges, and one with an apple and an orange.
00:39:37.700 --> 00:39:44.300
Of course, these bags are opaque, you cannot see into the bags and you cannot tell which fruit are in which bag.
00:39:44.300 --> 00:39:48.200
You pick one bag at random and you draw out one fruit.
00:39:48.200 --> 00:39:51.500
You look at the fruit and it turns out to be an apple.
00:39:51.500 --> 00:39:57.800
The question is, what is the chance that the other fruit in that same bag is also an apple?
00:39:57.800 --> 00:40:01.600
In other words, what is the chance that you got the bag with two apples?
00:40:01.600 --> 00:40:10.200
A lot of people think that the answer to this problem is ½ because you are obviously in the 2 apple bag or the apple orange bag.
00:40:10.200 --> 00:40:13.500
You think that it got to be one of the other, it must be ½.
00:40:13.500 --> 00:40:16.500
It turns out that that answer is not correct.
00:40:16.500 --> 00:40:21.200
This problem is a lot more subtle than that.
00:40:21.200 --> 00:40:25.300
What we want do is analyze this using Bayes’ rule.
00:40:25.300 --> 00:40:28.100
Let me set up some events here.
00:40:28.100 --> 00:40:31.700
My three events are going to be the three bags.
00:40:31.700 --> 00:40:36.600
My B1 will be the apple-apple bag.
00:40:36.600 --> 00:40:39.100
That represents the bag with 2 apples.
00:40:39.100 --> 00:40:44.600
My B2 will be the apple-orange bag.
00:40:44.600 --> 00:40:49.300
My B3 will be the bag with 2 oranges.
00:40:49.300 --> 00:41:01.100
My overlapping event, the event that I'm given is true is the event A which is that we draw an apple.
00:41:01.100 --> 00:41:09.100
We are given that we drew an apple and then the question is what is the probability that we are in the 2 apple bag?
00:41:09.100 --> 00:41:19.300
Let me just make a diagram of how everything here fits together.
00:41:19.300 --> 00:41:24.500
We got these three bags here.
00:41:24.500 --> 00:41:27.000
The three bags do not overlap each other.
00:41:27.000 --> 00:41:30.600
There is the apple-apple bag.
00:41:30.600 --> 00:41:33.100
There is the apple-orange bag.
00:41:33.100 --> 00:41:38.000
There is the orange-orange bag.
00:41:38.000 --> 00:41:44.100
We have this other event that overlaps them all.
00:41:44.100 --> 00:41:54.000
Actually, this is not quite drawn accurately because this is the event that we drew an apple.
00:41:54.000 --> 00:41:59.200
If we drew an apple then we could not have been drawing from the orange-orange bag.
00:41:59.200 --> 00:42:04.200
This region right here is actually does not exist.
00:42:04.200 --> 00:42:08.200
It does not overlap into orange-orange category here.
00:42:08.200 --> 00:42:13.500
But that is okay, the calculations that we do will take that into account.
00:42:13.500 --> 00:42:15.500
We do not really need to worry about that.
00:42:15.500 --> 00:42:17.400
We do not need to make a special case for that.
00:42:17.400 --> 00:42:20.400
That will be built into the calculations later on.
00:42:20.400 --> 00:42:26.800
What we are really trying to find out is the probability that assuming that we drew an apple,
00:42:26.800 --> 00:42:31.400
what is the chance that the other fruit in the same bag is an apple?
00:42:31.400 --> 00:42:38.900
That means that we must have been drawing from the bag that has 2 apples.
00:42:38.900 --> 00:42:44.200
What we are asking that, what is the chance, let me make that a little more clear.
00:42:44.200 --> 00:42:53.000
The probability that we are in the apple-apple bag given that we drew an apple as the first fruit.
00:42:53.000 --> 00:42:56.000
That is what we are trying to calculate.
00:42:56.000 --> 00:43:03.400
I'm going to expand this out using Bayes’ rule on the next slide.
00:43:03.400 --> 00:43:06.800
Let me just remind you what these events are.
00:43:06.800 --> 00:43:22.100
We got 2 apples, we got an apple-orange bag, we got a 2 orange bag.
00:43:22.100 --> 00:43:26.800
Those fit together as a disjoint union to cover all the possible outcomes.
00:43:26.800 --> 00:43:29.400
We know we are going to draw one fruit.
00:43:29.400 --> 00:43:33.300
It is going to come from one of the bags and bags do not overlap.
00:43:33.300 --> 00:43:36.900
There is this event that we are given that we draw an apple.
00:43:36.900 --> 00:43:40.200
That does overlap into the different categories.
00:43:40.200 --> 00:43:44.600
And we are given that that is true and we want to find the probability that
00:43:44.600 --> 00:43:50.400
we are in the apple-apple bag given that we drew an apple.
00:43:50.400 --> 00:43:51.800
Let us calculate that out.
00:43:51.800 --> 00:43:57.800
I’m going to use the Bayes’ rule formula for multiple possibilities.
00:43:57.800 --> 00:44:02.800
That is the formula that I gave you on the third slide of this lecture.
00:44:02.800 --> 00:44:06.100
You can go back in the video and you can find that.
00:44:06.100 --> 00:44:08.300
I will remind you what the formula is now.
00:44:08.300 --> 00:44:18.700
The probability of B sub J given A is equal to, you flip the probability of A given B sub J ×
00:44:18.700 --> 00:44:41.600
the probability of B sub J divided by the sum from I equals 1 to N of the probability of A given B sub I
00:44:41.600 --> 00:44:44.300
× the probability of B sub I.
00:44:44.300 --> 00:44:47.600
And that is the formula we are going to be using.
00:44:47.600 --> 00:44:54.000
What we are trying to calculate in this particular problem is the probability that
00:44:54.000 --> 00:45:00.600
we are in the apple-apple bag given that we drew an apple initially.
00:45:00.600 --> 00:45:08.800
I'm going to expand that out using the Bayes’ formula for multiple events.
00:45:08.800 --> 00:45:17.300
It is according to the formula, you switch and you have the probability of the apple given B sub AA ×
00:45:17.300 --> 00:45:22.000
the probability of B sub AA.
00:45:22.000 --> 00:45:29.700
The denominator is going to be a little long and messy because we have three different events we need to calculate here.
00:45:29.700 --> 00:45:39.100
The probability of the apple given B sub AA × the probability of B sub AA +
00:45:39.100 --> 00:45:46.500
the probability of the apple given B sub AO, that was our second event there.
00:45:46.500 --> 00:45:49.600
× the probability b sub AO.
00:45:49.600 --> 00:46:11.300
And one more event here is the probability of the apple given B sub OO × the probability of B sub OO.
00:46:11.300 --> 00:46:15.200
I can fill in a lot of these probabilities.
00:46:15.200 --> 00:46:17.900
Remember, we are going to pick one of these bags at random.
00:46:17.900 --> 00:46:20.100
Let me fill in those probabilities first.
00:46:20.100 --> 00:46:23.400
The probability that we are in the 2 apple bag is 1/3.
00:46:23.400 --> 00:46:26.700
The probability here that we are in the 2 apple bag is 1/3.
00:46:26.700 --> 00:46:29.200
The probability that we are in the apple-orange bag is 1/3.
00:46:29.200 --> 00:46:32.500
The probability that we are in the orange-orange bag is 1/3.
00:46:32.500 --> 00:46:36.400
We are calculating those before we know that we drew out an apple.
00:46:36.400 --> 00:46:42.400
That is why those are each 1/3 because we do not yet have any information that we drew out an apple.
00:46:42.400 --> 00:46:46.300
But now, let us calculate these other conditional probabilities.
00:46:46.300 --> 00:46:51.000
If we are in the apple-apple bag, what is the probability that we would get an apple?
00:46:51.000 --> 00:46:58.100
If we know we are in the bag with 2 apples, then the probability that we get an apple is 100% or 1.
00:46:58.100 --> 00:47:02.500
The probability of apple given 2 apples is 1.
00:47:02.500 --> 00:47:08.300
The probability of an apple given that we are in the apple-orange bag.
00:47:08.300 --> 00:47:11.800
For the apple-orange bag, what is the probability of getting apple?
00:47:11.800 --> 00:47:15.700
There are 2 fruits in there, one of them is an orange.
00:47:15.700 --> 00:47:17.900
It is a ½.
00:47:17.900 --> 00:47:24.000
The probability of getting an apple given that we are in the orange-orange bag is 0.
00:47:24.000 --> 00:47:29.200
Because if you are in the orange-orange bag, there is no way you can get an apple.
00:47:29.200 --> 00:47:33.600
When you combine all these numbers together, I think that is the hard part already done now.
00:47:33.600 --> 00:47:35.300
You just have to do a little arithmetic.
00:47:35.300 --> 00:47:38.800
We get 1 × 1/3 in the top.
00:47:38.800 --> 00:47:48.800
In the bottom, we get 1 × 1/3 + ½ × 1/3 + 0.
00:47:48.800 --> 00:47:51.800
That 0 drop right out.
00:47:51.800 --> 00:47:53.700
You know I got a 1/3 everywhere.
00:47:53.700 --> 00:48:04.700
If I multiply the top and bottom × 3 then I will get a 1/1 + ½ which is 1/ 3/2.
00:48:04.700 --> 00:48:11.000
If I can fit that around, I get 2/3.
00:48:11.000 --> 00:48:18.000
That is a little bit surprising because you remember, when we first looked at that problem,
00:48:18.000 --> 00:48:23.300
we said if we got an apple, we know we must be in the apple-apple bag or we must be in the orange-orange bag.
00:48:23.300 --> 00:48:31.800
You would think at that point, it is a 50-50 chance that you are in the 2 apple bag or the apple-orange bag.
00:48:31.800 --> 00:48:34.000
But in fact, that is not true.
00:48:34.000 --> 00:48:40.600
Essentially, if you got an apple it is telling you that that is more likely to have occurred
00:48:40.600 --> 00:48:44.500
by pulling it out of the apple-apple bag.
00:48:44.500 --> 00:48:50.000
Bayes’ rule kind of gets you out of a very sticky and counterintuitive situation.
00:48:50.000 --> 00:48:56.800
Intuition might tell you that there is a 50-50 chance but the calculations actually tell you, and they are correct,
00:48:56.800 --> 00:49:01.300
that there is a 2/3 chance that you were in the apple-apple bag.
00:49:01.300 --> 00:49:07.000
There is a 2/3 chance of the other fruit in the bag is indeed an apple.
00:49:07.000 --> 00:49:10.100
Let me remind you how that went.
00:49:10.100 --> 00:49:16.700
We were calculating from the previous page that we are assuming that we have an apple and
00:49:16.700 --> 00:49:23.000
we want to find the probability that we are in an apple-apple bag.
00:49:23.000 --> 00:49:27.500
I use the Bayes’ rule formula for multiple events.
00:49:27.500 --> 00:49:31.000
I got that from one of the earlier slides in the lecture.
00:49:31.000 --> 00:49:39.800
It says that the probability of any particular event given this overlapping event is the probability,
00:49:39.800 --> 00:49:42.000
the conditional probability we kind of switch them.
00:49:42.000 --> 00:49:47.800
A given B sub J × the probability of B sub J and then we moved the denominator.
00:49:47.800 --> 00:49:54.400
You add up all the events, A given B sub I × the probability of B sub I.
00:49:54.400 --> 00:50:02.100
In this case, our events were the B₁ was the apple-apple bag.
00:50:02.100 --> 00:50:06.800
The B₂ was the apple-orange bag.
00:50:06.800 --> 00:50:11.200
B₃ was the orange-orange bag.
00:50:11.200 --> 00:50:15.600
That is how I expanded out the denominator there.
00:50:15.600 --> 00:50:19.800
The apple-apple, apple-orange, and orange-orange.
00:50:19.800 --> 00:50:25.300
The numerator is the one we are interested in, that is the apple-apple.
00:50:25.300 --> 00:50:30.800
We expand all that big formula out, then we fill in all the probabilities.
00:50:30.800 --> 00:50:36.300
The probability of each bag without knowing that we have an apple is just 1/3.
00:50:36.300 --> 00:50:40.200
That is where I got all of those numbers being 1/3.
00:50:40.200 --> 00:50:45.100
And then the probabilities of getting an apple added each bag is a little trickier.
00:50:45.100 --> 00:50:49.000
If you are in the apple-apple bag, you are guaranteed to get an apple.
00:50:49.000 --> 00:50:52.000
That is a 1.
00:50:52.000 --> 00:50:53.900
That is where that one come from as well.
00:50:53.900 --> 00:50:58.100
If you are in the apple-orange bag, there is a ½ chance that you get an apple.
00:50:58.100 --> 00:51:02.500
If you are in the orange-orange bag, there is a 0 chance that you get an apple.
00:51:02.500 --> 00:51:04.400
That is where that 0 comes from.
00:51:04.400 --> 00:51:18.500
It is just a matter of collecting all the fractions together and doing a little arithmetic to simplify it down to 2/3.
00:51:18.500 --> 00:51:26.400
In our last example for Bayes’ rule here, we got a family that has 3 children and we are given that there are no twins.
00:51:26.400 --> 00:51:36.300
We are given that there are at least 2 girls and we want to find the probability that the oldest child of those 3 children is a girl.
00:51:36.300 --> 00:51:41.000
Again, let me setup some events here.
00:51:41.000 --> 00:51:44.300
We are asked the probability that the oldest child is a girl.
00:51:44.300 --> 00:51:57.800
Let me set up an event B1 is the event that the oldest child is a girl.
00:51:57.800 --> 00:52:03.900
And that oldest child could also be a boy.
00:52:03.900 --> 00:52:09.600
I will call that B2 is a boy.
00:52:09.600 --> 00:52:13.500
Overlapping both of those is the event that we are given.
00:52:13.500 --> 00:52:15.700
We are given that there are at least 2 girls.
00:52:15.700 --> 00:52:24.500
My event A will be that there are at least 2 girls.
00:52:24.500 --> 00:52:35.200
Let me draw a map of this experiment.
00:52:35.200 --> 00:52:44.100
This B1 and B2 are disjoint events because that oldest child is either a boy or a girl.
00:52:44.100 --> 00:52:48.500
There is B1 and there is B2.
00:52:48.500 --> 00:52:56.200
But overlapping both of those is the possibility that at least 2 of them could be a girl.
00:52:56.200 --> 00:53:00.000
That is my A.
00:53:00.000 --> 00:53:07.200
And we are given that A is true and we want to find the probability that the oldest child is a girl.
00:53:07.200 --> 00:53:20.700
We want to find the probability of B1 given that A is true, given that at least 2 of the children are girls.
00:53:20.700 --> 00:53:23.400
We have a formula for that, that we have two events here.
00:53:23.400 --> 00:53:26.200
This is really using Bayes’ rule for two events.
00:53:26.200 --> 00:53:28.900
Let me expand out that formula.
00:53:28.900 --> 00:53:35.000
According to the second slide of this lecture, you can just play it back and find it, if you do not remember it.
00:53:35.000 --> 00:53:39.700
It is P of A given B1.
00:53:39.700 --> 00:53:44.900
I will switch those around, × P of B1.
00:53:44.900 --> 00:53:48.200
In the denominator is that same expression.
00:53:48.200 --> 00:53:50.100
Let me copy that again.
00:53:50.100 --> 00:54:00.000
P of A given B1 × P of B1 + the same thing with B2.
00:54:00.000 --> 00:54:08.000
A given B2 × the probability of B2.
00:54:08.000 --> 00:54:14.300
We have to figure out all those probabilities and drop them into the formula and calculate it out.
00:54:14.300 --> 00:54:17.100
The probability of B1 is fairly easy.
00:54:17.100 --> 00:54:22.300
That is the probability of the oldest child is a girl, that is ½.
00:54:22.300 --> 00:54:23.400
We can fill that in.
00:54:23.400 --> 00:54:27.600
The probability that the oldest child is a boy is also ½.
00:54:27.600 --> 00:54:33.600
That is at least if you have no extra information about that.
00:54:33.600 --> 00:54:39.700
The probability of A given B1 and A given B2 is a little trickier.
00:54:39.700 --> 00:54:42.700
We calculate those down here.
00:54:42.700 --> 00:54:52.300
The probability of A given B1 that means that we are given that the oldest child is a girl.
00:54:52.300 --> 00:54:58.900
We are given that the first child is a girl.
00:54:58.900 --> 00:55:04.200
We want to figure out the probability that at least 2 children are girls.
00:55:04.200 --> 00:55:13.200
The probability that at least 2 children are girls, if the first child is a girl means the probability that
00:55:13.200 --> 00:55:30.000
at least 1 of the younger 2 children is a girl.
00:55:30.000 --> 00:55:32.400
We got 2 younger children here.
00:55:32.400 --> 00:55:42.300
The 2 younger children could be a girl – boy, girl – girl, it could be boy – girl.
00:55:42.300 --> 00:55:47.000
It could be boy – boy.
00:55:47.000 --> 00:55:57.500
At least one of them being a girl, there is 3 of those situations where at least 1 of them is a girl, that is ¾.
00:55:57.500 --> 00:56:02.700
The probability of A given B2, we need to fill that in.
00:56:02.700 --> 00:56:08.500
That is the probability of at least 2 girls given that the oldest child is a boy.
00:56:08.500 --> 00:56:18.000
If the oldest child is a boy, then to get at least 2 girls, you got to have both of the younger 2 being girls.
00:56:18.000 --> 00:56:34.800
Both of younger 2 must be girls.
00:56:34.800 --> 00:56:39.800
If you look at the same listing above, there is 1 out of 4 situations.
00:56:39.800 --> 00:56:44.200
There gives you both of the younger 2 being girls, that is 1 out of 4.
00:56:44.200 --> 00:56:47.200
I can fill in these numbers here.
00:56:47.200 --> 00:56:51.100
Probability of A given B1 was ¾.
00:56:51.100 --> 00:56:54.600
This probability is 1 out of 4.
00:56:54.600 --> 00:56:59.000
That was also ¾, just like below.
00:56:59.000 --> 00:57:02.900
I can just write this in terms of numbers now.
00:57:02.900 --> 00:57:14.400
¾ × ½/ ¾ × ½ + ¼ × ½.
00:57:14.400 --> 00:57:16.200
I see I got a ½ everywhere.
00:57:16.200 --> 00:57:20.500
I can erase those if I multiply top and bottom by 2.
00:57:20.500 --> 00:57:24.900
I know that I got ¼ everywhere.
00:57:24.900 --> 00:57:29.600
If I multiply top and bottom by 4 as well, that will cancel all my 4th.
00:57:29.600 --> 00:57:32.100
In the top, that will just leave me with a 3.
00:57:32.100 --> 00:57:35.900
In the bottom, that will leave me with 3 + 1.
00:57:35.900 --> 00:57:39.200
I have getting rid of all my denominators there.
00:57:39.200 --> 00:57:45.300
I get 3 out of 4 and that is my final probability.
00:57:45.300 --> 00:57:53.300
If I know that there at least 2 girls in the family, the probability that the oldest child is a girl is ¾.
00:57:53.300 --> 00:57:56.000
Let me recap that problem here.
00:57:56.000 --> 00:57:58.500
We are given that there at least 2 girls.
00:57:58.500 --> 00:58:00.700
I will set that up as my event A.
00:58:00.700 --> 00:58:04.000
We want to find the probability that the oldest child is a girl.
00:58:04.000 --> 00:58:08.400
I set up one event for that, the oldest child being a girl.
00:58:08.400 --> 00:58:13.100
I see that I called that B1, that should have been B2.
00:58:13.100 --> 00:58:15.300
Let me change that.
00:58:15.300 --> 00:58:21.700
I will get some good comments saying you got the wrong B1 there.
00:58:21.700 --> 00:58:25.200
I have made that a B2.
00:58:25.200 --> 00:58:28.000
B1 is that the oldest child is a girl.
00:58:28.000 --> 00:58:31.600
B2 is that the oldest child is a boy.
00:58:31.600 --> 00:58:39.800
That divides my world into two disjoint events.
00:58:39.800 --> 00:58:45.300
The event of there are being at least 2 girls, that overlaps both of them.
00:58:45.300 --> 00:58:52.800
We want to find the probability that the oldest child is a girl given that there are at least 2 girls.
00:58:52.800 --> 00:59:00.500
That is P of B1 given A and then using my Bayes’ formula for two events,
00:59:00.500 --> 00:59:04.300
this is copied off the second slide of the lecture.
00:59:04.300 --> 00:59:06.500
You can go back and just look up this formula.
00:59:06.500 --> 00:59:14.500
That expands into A given B1 × B1, A given B1 × B1, A given B2 × B2.
00:59:14.500 --> 00:59:18.100
I want to fill in those probabilities and that is probably the trickiest part here.
00:59:18.100 --> 00:59:21.700
The probability of B1 is the probability that the oldest child is a girl.
00:59:21.700 --> 00:59:24.400
No problem, that is ½.
00:59:24.400 --> 00:59:28.600
The probability that the oldest child is a boy, that is also ½.
00:59:28.600 --> 00:59:31.300
A given B1, that is a little trickier.
00:59:31.300 --> 00:59:33.500
That is what I was working out here.
00:59:33.500 --> 00:59:41.200
That says, what is the probability of getting at least 2 girls given that the oldest child is a girl?
00:59:41.200 --> 00:59:52.000
If the oldest child is guaranteed to be a girl, to get at least 2 girls, you have to get at least 1 girl in the next 2 children.
00:59:52.000 --> 00:59:55.300
At least 1 of the younger 2 children must be a girl.
00:59:55.300 --> 01:00:03.800
And then I wrote out the possibilities that these are the younger 2 children that I wrote out here, the younger 2.
01:00:03.800 --> 01:00:11.200
The other 2 children could be girl – boy, girl – girl, boy – girl, or boy- boy.
01:00:11.200 --> 01:00:14.500
How many of those have at least one of them being a girl?
01:00:14.500 --> 01:00:18.400
There are 3 of those possibilities, that is 3 out of 4.
01:00:18.400 --> 01:00:23.400
That is where this ¾ came from and that is where this ¾ came from.
01:00:23.400 --> 01:00:37.900
A given B2, this one right here means that the probability of getting at least 2 girls given that the oldest child is a boy.
01:00:37.900 --> 01:00:46.500
If you want 2 girls and the oldest child is a boy, then both of the younger 2 must be girls, in order to get 2 girls.
01:00:46.500 --> 01:00:49.200
There is only one way to get that, that is right there.
01:00:49.200 --> 01:00:52.000
That is why we have a 1 out of 4 chance.
01:00:52.000 --> 01:00:56.300
That is where that ¼ comes from.
01:00:56.300 --> 01:00:58.300
We have put all the fractions in.
01:00:58.300 --> 01:01:05.200
It is just a simple matter of canceling all the denominators and multiply it by 2/2 to get rid of all the halves.
01:01:05.200 --> 01:01:13.400
Multiplying by 4/4 to get rid of the 4th and turn into 3/3 + 1 which simplifies down to ¾.
01:01:13.400 --> 01:01:21.200
If we know that there at least 2 girls, the probability that the oldest child is a girl is now ¾.
01:01:21.200 --> 01:01:24.700
That wraps up the lecture in the examples on Bayes’ rule.
01:01:24.700 --> 01:01:28.900
It is a pretty complicated rule and it is very counterintuitive.
01:01:28.900 --> 01:01:36.200
I strongly recommend using the formula for Bayes’ rule even when it leads you to answers that might counteract your intuition.
01:01:36.200 --> 01:01:40.600
Certainly, some of these answers seem kind of surprising to me.
01:01:40.600 --> 01:01:44.200
The formula is guaranteed to be true.
01:01:44.200 --> 01:01:49.400
When you set things up right, you set up your disjoint events, and you setup your overlapping event
01:01:49.400 --> 01:01:55.500
then you can just follow the formula after that and you will get your answer.
01:01:55.500 --> 01:01:58.500
This is the end of the lecture on Bayes’ rule.
01:01:58.500 --> 01:02:02.700
This is part of the larger probability series here on www.educator.com.
01:02:02.700 --> 01:02:07.900
I’m your teacher Will Murray, we will be working through some more probability lectures.
01:02:07.900 --> 01:02:10.000
I hope you will stick around for those and thank you for joining us, bye.