# Bayes theorem, disease probability

There is a new test for a disease. This disease occurs in 3% of the population. We have experimental evidence that

If someone has the disease, then the test will give a positive result 95% of the time, and a negative result 5% of the time

If someone does not have the disease, the test is positive 6% of the time, and negative 94% of the time

We take a person “off the street” and run the test on them.

1. If the test is positive, what is the probability that they have the disease?

2. If the test is negative, what is the probability that they have the disease?

Now assume we have some additional evidence that changes the likelihood of a person that we are testing from 3% to 30%. What are the probabilities above now?

As solutions I got:

 1. (0.03 * 0.95/0.95) * 0.03 / ((0.03 * 0.95) + (0.97 * 0.06)) = 32.87%

2. (0.03 * 0.05/0.05) * 0.03 / ((0.03 * 0.05) + (0.97 * 0.94)) = 0.00098

3. (0.3 * 0.95/0.95) * 0.3 / ((0.3 * 0.95) + (0.7 * 0.06)) = 27.52%

4. (0.3 * 0.05/0.05) * 0.3 / ((0.3 * 0.05) + (0.7 * 0.94)) = 13.372%


Are my results correct? Thanks

1. $(0.03 * 0.95/0.95) * 0.03 / ((0.03 * 0.95) + (0.97 * 0.06)) = 32.87\%$

2. $(0.03 * 0.05/0.05) * 0.03 / ((0.03 * 0.05) + (0.97 * 0.94)) = 0.00098$

3. $(0.3 * 0.95/0.95) * 0.3 / ((0.3 * 0.95) + (0.7 * 0.06)) = 27.52\%$

4. $(0.3 * 0.05/0.05) * 0.3 / ((0.3 * 0.05) + (0.7 * 0.94)) = 13.372\%$

Are my results correct? Thanks

No.   I am not sure what you are even trying to do for the numerator; but stop doing that.

1. $\mathsf P(D\mid T)~{=\dfrac{\mathsf P(D)\mathsf P(T\mid D)}{\mathsf P(D)\mathsf P(T\mid D)+\mathsf P(D^\complement)\mathsf P(T\mid D^\complement)}\\=\dfrac{(0.03 * 0.95) }{ ((0.03 * 0.95) + (0.97 * 0.06))}}$

and so forth.