Hiho,
Consider country A. 6% of its inhabitants is infected with malaria. A test was developed to track down malaria. This test is not always correct. The test gives an incorrect result for 1% of the healthy inhabitants. The test gives an incorrect result for 2% of the infected inhabitants. What are the odds for someone tested positive for malaria to actually be infected with malaria?
A. 0.06
B. 0.068
C. 0.86
D. 0.99
E. 0.0595
I have absolutely no idea how to apply Bayes' theorem here, but alas, here's what I've got.
Code
Out of x positive tests, 1% is a false positive and thus 99% of the positive tests are true positives.
Let positive outcome = p and let infected inhabitant = i, negative outcome = np and not infected = ni
P(p and i)=0,99
P(i)=0,06
P(p and ni) = 0,01
P(ni) = 0,94 (the remainder of the inhabitants, 1,00 - 0,06)
I'm looking for the chance that a positive outcome means that the inhabitant is indeed infected: P(i|p)
P(i|p) is defined as P(i and p) / P(p)
P(i and b) / P(p) = (0,99 * 0,06) / (0,99*0,06 + 0,01 * 0,94) = 0,8634 ----> C is correct
It feels counterintuitive to multiply P(p) by the amount of inhabitants that are infected (0,99*0,06 instead of 0,99)? I did it anyway because the answer I would've gotten otherwise seems ridiculous.
I know C is indeed the right answer. Maybe somebody could answer this particular assignment in words so I can have a better understanding of what the numbers mean.
This post was edited by Forg0tten on Jun 21 2017 12:06pm