The doctor has bad news and good news for X. The bad news is that X tested positive for a serious disease, and that the test is 99% accurate (i.e., the probability of testing positive given that you have the disease is 0.99, as is the probability of testing negative given that you don’t have the disease). The good news is that this is a rare disease, striking only one in 10,000 people. Why is it good news that the disease is rare? What are the chances that X actually has the disease?


In [3]:
p_pos_given_dis = 0.99
p_pos_given_dis_not = 1 - p_pos_given_dis
p_neg_given_dis = 0.99

p_dis = 1 / 10000
p_dis_not = 1 - p_dis

p_pos = p_pos_given_dis * p_dis + p_pos_given_dis_not * p_dis_not

p_dis * p_pos_given_dis / p_pos


Out[3]:
0.009803921568627442

In [ ]: