Теорема Байеса для болезни 1% и теста 99%
Теорема Байеса для болезни 1% и теста 99%
Ответить самому
Сначала сформулируйте ответ как на собеседовании, затем откройте разбор и оцените себя.
Короткий ответ
The posterior is 50%. Among 10,000 people, about 100 are sick and 99 of them test positive; among 9,900 healthy people, 99 false positives occur, so positives split 99 sick vs 99 healthy.
Полный разбор
Use Bayes theorem:
P(sick | positive) = P(positive | sick) P(sick) / P(positive).
Here P(sick) = 0.01, P(positive | sick) = 0.99 and P(positive | healthy) = 0.01. The denominator is:
0.99 * 0.01 + 0.01 * 0.99 = 0.0099 + 0.0099 = 0.0198.
The numerator is 0.99 * 0.01 = 0.0099, so the posterior is 0.0099 / 0.0198 = 0.5.
The intuitive count version is often safer in interviews. Out of 10,000 people, 100 are sick and 9,900 are healthy. The test catches about 99 sick people and falsely flags about 99 healthy people. A positive result is therefore equally likely to be a true positive or a false positive.
Теория
When the base rate is low, even a very accurate symmetric test can have surprisingly low precision.
Типичные ошибки
- Answer 99% because the test accuracy is 99%.
- Forget the false positives from the much larger healthy population.
- Use sensitivity but omit prevalence in the numerator.
Как отвечать на собеседовании
- Draw a 10,000-person table if algebra gets messy.
- Name sensitivity and false-positive rate explicitly before calculating.