Skip to content

Exercise 5

A city has 1 000 000 people. Assume that currently 2% of the population has a disease. A person is selected randomly and then is tested for the disease. Assume that the accuracy of the test is 99%.

  1. What is the probability of the event A = {test’s result is +}?
  2. Let B = {the selected person has the disease}. Calculate P(B|A).

Answer

Q1

Using the law of total probability: P(A) = P(+|diseased)·P(diseased) + P(+|not diseased)·P(not diseased)

P(A) = 0.99 × 0.02 + 0.01 × 0.98 P(A) = 0.0198 + 0.0098 P(A) = 0.0296 = 2.96%

Q2

Using Bayes' theorem: P(B|A) = P(A|B)·P(B) / P(A)

Where:

  • P(A|B) = P(+|diseased) = 0.99
  • P(B) = P(diseased) = 0.02
  • P(A) = 0.0296 (from part i)

P(B|A) = (0.99 × 0.02) / 0.0296 P(B|A) = 0.0198 / 0.0296 P(B|A) = 0.6689 ≈ 66.89%