A patient takes a special cancer test which has the accuracy test_accuracy=99.9%: if the result is positive, then 99.9% of the patients tested will suffer from the special type of cancer. 99.9% of the patients with a negative result do not suffer from the cancer.
Suppose that a patient is tested and scores positive on the test. What is the probability that a patient suffers from the special type of cancer?
Analysis:
We will use Bayes' theorem to find out the probability of the patient having the cancer:
P(cancer|test_positive)=(P(test_positive|cancer) * P(cancer))/P(test_positive)
To know the prior probability that a patient has the cancer, we have to find out how frequently the cancer occurs among people. Say that we find out that 1 person in 100,000 suffers from this kind of cancer. Then P(cancer)=1/100,000. So, P...