In this part, we consider somehow counter-intuitive test.

Example which is related to conditional probability,

just that a test of disease example.

So let me explain what I mean.

You may know there are some disease which is not very rare,

but rather a 1% of all people in some population have this disease.

And you have a test for this disease and

every test can give false positives and false negative.

So false negative, the test is negative while you are ill,

and false positive is that the test is positive if you're not ill.

So the rate means that there's 1/10 of all people who have the disease get negative test.

So it's somehow 90% reliable, so to say.

And also a false positive rate is equally small.

If you are not ill,

then probability to get a false positive test is 1/10.

So again 90% people are classified correctly.

And imagine that now you are informed that your test is positive.

And the question is how much should you be worried?

Of course you should be. But what is the probability of you are really ill?

So in terms of our probability theory,

we can say like this.

So the probability of the disease is 1/100,

and the conditional probability of test if you really have the disease is 90%.

So this is false negative, so to say.

False negative if the test doesn't show you.

So this is the complement.

And here's false positive.

You are not ill, but you get a positive test and this happens probability of 1/10.

Okay, this is what is given, and the question is,

what are the conditional probability of having

a disease under the conditions that you are test positive?

So you can stop here and think,

what do you think,

is it high or not?

I think that many people will say that,

look test is quite reliable,

90% is almost most of the cases it's correct.

So most probably I have the disease.

Well many people will think so,

but it's a wrong understanding.

So it's a good idea before going into panic,

you should think a bit and compute a bit and then you understand the situation better.

So let me tell you what I mean.

We compute things slowly.

There is 1% of ill people here,

and 90% of these ill people are positive.

So it's 90% of 1%,

so it's just 0.9% positive and ill.

But also there is 99% of healthy people,

and some of them are also positive.

Just one tenth of them test positive.

So they are 10 percentage of this,

and so we have 9.9 percentage in the population of people who are positive but healthy.

And now you already see that positive and ill,

is much smaller than positive and healthy.

It's just in proportion 1 to 11.

So if you look at all positive people and find one of every 12 positive people,

one is really ill and 11 is healthy so it's not so bad.

Only the probability to be ill,

assuming you test positive is 1/12.

And the same computation can be done in terms of probability theory.

Let me repeat it slowly again.

So here's what we start with,

the probability of the disease,

the conditional probability of positive test,

if the disease happens and the probability of test,

if the disease doesn't happen.

This is what is given.

Now that is what we want to compute,

and now we make the computation.

So first we start up the probability test indices,

and the formulas will multiply the probability of disease,

by the conditional probability.

And so we get this and this is nine out of thousand.

And if you compare this with test and healthy,

we also do the same.

We have 99% of people who have no this disease,

and among them there is 1/10 who are test positive so we get this number.

And then we can just compute the probability of being positive.

It's just the two disjoint cases,

so the sum of the probabilities works and we can just add

these two numbers and get this sum.

Now, we can just compute the conditional probability according to the definition.

So the probability is that you have disease,

under the condition you have test positive,

is by definition a fraction, a ratio of these two probabilities,

and so you know both of them.

This is this one and this is this one.

So you divide this and you get 1/12 as before.

Of course as before we do the same.

So it's like 8.3%,

and it's not so big.

So this is counter-intuitive but now probably it's not so strange as before.

Let me say what we used in this computation,

we used something which has a serious name,

the law of total probability but actually it's trivial thing.

Imagine the probability space is split into these joint subsets,

which form the entire space.

So they are mutually exclusive and exhaustive list of cases,

B1, B2 and so on Bn.

So there are events that are mutually exclusive and always

one in every outcome belongs to one and only one of them.

There is a language of said theory, mutual exclusive events.

Let me draw something.

The entire space is split into these events.

And then we have A, some subset,

and it also is split into smaller events here which are A and B1.

So this is B1. This is A and B1,

B2, A and B2 and so on.

Our A, is split into mutually exclusive events,

and so we can compute the probability of A, as a sum.

Probablitiy of A is the sum of the probability of these individual events A and B1,

A and B2 and so on.

And each of them can be computed according

to the definition of conditional probability like this.

So this for example is the product of B1,

probability of B1, and the probability of A,

under the condition B1.

And so we just get this formula,

and this formula is called the Law of Total Probability.

For the case when there's B1 and B2,

only two events, we have somehow B and not B.

Here is what is the same.

It's probability of B times the conditional probability.

This is probability of not B,

and this is the conditional probability.

So we have just a special case.

That's what we did actually in our computation.

So we apply this Law of Total Probability in the case when we have only two