How do you apply Bayes’ Rule to medical testing?

Adenocarcinoma_coliThe probability of colorectal cancer can be given as .3%. If a person has colorectal cancer, the probability that the hemoccult test is positive is 50%. If a person does not have colorectal cancer, the probability that he still tests positive is 3%.

What is the probability that a person who tests negative does not have colorectal cancer?

To solve this problem, we’ll draw and label an appropriate tree diagram. Then we’ll apply Bayes’ Rule to the problem. Look at the information given in the problem. If

C is the event “person has colorectal cancer”

+ is the event “the hemoccult test is positive”

– is the event “the hemoccult test is negative”

we know that

P(C) = 0.003

P(+ | C) = 0.5

P(+ | ′ ) = 0.03

This suggests the following tree diagram:


Knowing that the sum of the probabilities from one point on the tree should add to 1, we can finish the tree diagram as follows:


The probability we are looking for is P(C ′ | -). Notice that the tree diagram has P(- | C ′ ), but not the reverse conditional probability that we are looking for. This is a sign we need to use Bayes’ Rule. Let’s find the appropriate form of Bayes’ Rule. The relationship between the conditional probabilities is

med_testing_03Solving for P(C ′ | -) gives


This is Bayes’ Rule for this problem. Now we are ready to use the tree diagram. P(- | C ′ ) and P(C ′ ) are both labeled on the tree diagram. We can calculate P(-) by following the branches on the tree diagram (multiply) that lead to a negative result, and then summing up the products from these branches.


Putting these values into Bayes’ Rule gives


This means that is you test negative, the likelihood that you do not have colorectal cancer is 99.85%. The test is quite good at screening that you do not have the disease.

Fight Spam with Bayes’ Rule

It might surprise you to know that in 2013, 70.7% of all worldwide emails were spam. Spam emails are unsolicited email that are sent out in bulk. To combat these emails, companies utilize spam filters provided by software companies to block the spam emails from reaching the desired recipient.

One provider, SpamTitan, advertises the following data

  • It blocks 99.9% of all spam email.
  • It blocks 0.03% of all emails that are not spam.

Based on the information above, what is the probability that a delivered email is spam?

Goto MathFAQ