Example 18: HIV test: has HIV, given a positive report,
Suppose that the reliability of a HIV test is specified as follows:
Of people having HIV, 90% of the test detect the disease but 10% go undetected. Of people free of HIV, 99% of the test are judged HIV-ive but 1% are diagnosed as showing HIV+ive. From a large population of which only 0.1% have HIV, one person is selected at random, given the HIV test, and the pathologist reports him/her as HIV+ive. What is the probability that the person actually has HIV?
Let : the person selected has HIV, and : the test report is positive (HIV+ive). Then : the person does not have HIV.
and form a partition of the sample space (a person either has HIV or does not).
By the theorem of total probability,
By Bayes' theorem,
The probability that the person actually has HIV is .
Want the reason behind every step, the basics and the checks?
A positive report has two sources. It comes from a person with HIV whose test detects it, or from a person without HIV who gets a false positive. HIV is rare here (1 person in 1000), so even a 1% false-positive rate among the many people without HIV produces far more positive reports than the true positives. Bayes' theorem measures the share of true positives.
- Given
- 0.1% of the population has HIV. The test reports positive for 90% of people with HIV and for 1% of people without HIV.
- To find
- The probability that a person with a positive report actually has HIV: .
- Plan
- (1) Name the events; check the partition. (2) Percentages as fractions. (3) Total probability for . (4) Bayes' theorem, then simplify.
Basics you need
; so . Basics: working with fractions
"Of people having HIV, 90% of the test detect the disease" is . Lesson: conditional probability
is the sum of the paths to ; is the path divided by . Lesson: Bayes' theorem
Solution
Name the events
Let
- : the person selected has HIV, so : the person does not have HIV;
- : the person's test is reported positive (HIV+ive).
is a partition of the sample space of all people in the population.
Having HIV or not is the cause; the positive report is the effect we observe. An event and its complement always form a partition when neither is impossible, so total probability and Bayes' theorem apply.is a partition. Lesson: Bayes' theoremEvery number as a fraction
The person is chosen at random from the population, so the chance of having HIV is the share 0.1%. "Of people having HIV, 90% ... detect the disease" is about people with HIV, so it is . "Of people free of HIV ... 1% are diagnosed as showing HIV+ive" is . The 10% and 99% are the chances of a negative report and are not needed. The book writes the same values as decimals: 0.001, 0.999, 0.9 and 0.01.The chance of a positive report: total probability
Since and form a partition, by the theorem of total probability
The tree for Example 18. The rose path (HIV, then positive) has product ; the green path (no HIV, then a false positive) has , about eleven times as much. A positive report happens through a true positive or a false positive, never both, so the two path probabilities add. To add them, write as .Multiply along a path, add the paths. Basics: tree diagramsHas HIV, given a positive report: Bayes' theorem
By Bayes' theorem,
Both 90 and 1089 are divisible by 9: and . So
The top is the true-positive path; the bottom is all positive reports. The common denominator 100000 cancels. and share no factor, so is in lowest terms. The book stops at and gives "0.083 approx.", which is rounded to three places.Simplify by the highest common factor, here 9. Basics: working with fractionsWhat the answer means
Only about 8 in 100 people with a positive report actually have HIV; the rest are false positives: , and .
The report still matters: it raises the chance of HIV from to , more than 80 times. That is why a positive screening test is followed by a second, confirmatory test.
People without HIV outnumber people with HIV 999 to 1. One in a hundred of them gets a false positive, so there are about 11 false positives for every true one ().for a partition. Lesson: Bayes' theorem
The probability that a person with a positive report actually has HIV is .
(Textbook answer: .)
Picture 1 000 000 people. of them, 1000, have HIV, and 90% of these, 900, are reported positive. The other 999 000 do not have HIV, and 1% of them, 9990, are reported positive too. So people are reported positive, and 900 of them have HIV: , the same as .
- Answering 0.9. 90% is , the chance that a person with HIV tests positive. The question asks for , the chance that a person who tests positive has HIV.
- Writing 0.1% as . .
- Using 99% instead of 1%. The false-positive rate is 1%; 99% is the chance that a person without HIV is (correctly) reported negative.
- For a rare condition, false positives from the large healthy group can outnumber the true positives, even for a good test.
- A large round population (here a million) turns the question into counting and is a quick check.
- The same calculation with other numbers: Exercise 13.3, Question 5.
Every fact used, and where it comes from
| Fact | Used in | Source |
|---|---|---|
| An event and its complement form a partition | Step 1 | Section 13.5.1 (Lesson: Bayes' theorem) |
| and | Step 2 | Class XI (Basics: rules of probability) |
| Conditional probability | Step 2 | Section 13.2 (Lesson: conditional probability) |
| Theorem of total probability | Step 3 | Section 13.5.2 (Lesson: total probability) |
| Bayes' theorem | Steps 4, 5 | Section 13.5 (Examples 15 to 21) |
| Cancelling a common factor | Step 4 | Arithmetic (Basics: working with fractions) |
Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →