# Example:Repeated medical test

Consider the medical test example. We saw that under some reasonable assumptions, the probability that someone has a disease given that the test is positive was 0.1%.

Perhaps this is not a high enough risk to justify performing an invasive procedure. Can we increase our confidence by taking a second test?

In our model, we defined various events: is the event that we have the disease, while is the event that we are healthy.

Let us use to indicate the event that the first test is positive, and to indicate the event that the first test is negative; define and similarly.

We were given in the problem that the false positive rate is 1%; this means that and . Similarly, we have that the false negative rate is 2%; this means that . Finally, we were given that .

Using these facts, we were able to compute that ; the same computation shows that .

Now, suppose both tests come back positive. What is the probability that we have the disease?

We want to compute .

We can organize this information into a probability tree:

However, we don't know what is. And this is sensible: depending on how the test works and what causes false positives, this probability could be anything:

• Perhaps the test gives a false positive if the patient has a genetic anomaly (which 1% of the population has). In this case, rerunning the test will give exactly the same result, so . Using this, we would find that .
• Perhaps the test gives a false positive because the lab technician dropped one of the 100 samples that they were testing and caused an incorrect result. In this case, a second run of the test cannot possibly fail, because there is only one incorrect test; therefore . Using this assumption, we would find that .
• Perhaps different iterations of the test fail independently. In this case, The false positive on the first test doesn't change the probability that the second test is a false positive. In this case, we have ; using the assumption that the first and second tests are independent, we can compute using a probability tree (or using Bayes' rule and the law of total probability):

Focusing on the branch, we see that . In the branch, we see that . By the law of total probability, we have

Using Bayes' rule, we have