# Bayes Rule Problem

How do I formalize this? And how do I calculate using the Bayes formula?

In the land of Pai, 3% of the population has a rare disease called Coditis. There is a test to test for Coditis: 18% of the population test positive on this test. The test is not that reliable: if someone that actually has Coditis gets tested, they only have a 60% chance of testing positive.

a) What is the chance of having Coditis if a citizen of Pai tests positive?
b) What is the chance of testing positive given that the citizen does not have Coditis?

• Which part are you asking about? Where did you get stuck when you attempted it? You use $$P(A|B)=\frac{P(B|A)P(A)}{P(B|A)P(A)+P(B|\neg A)P(\neg A)}$$ with appropriate definitions for $A$ and $B$ – John Doe Apr 24 '18 at 12:41
• I'd like to formalize it in order to use the formula and solve the given questions. It's a mess in my head right now. I thought I understood the Bayes theorem... – Simeon A Apr 24 '18 at 12:43
• You have two events (in usual sense, not mathematical sense): 1. test positive 2. have Coditis. Use two alphabets to represent them and translate the given conditions into statements like $P(A \mid B) = 0.1234$ – GNUSupporter 8964民主女神 地下教會 Apr 24 '18 at 12:48
• – amd Apr 24 '18 at 17:27

For part (a) you want prob of having the disease, given you tested positive. You want this to be represented by $P(A|B)$ (which is on the LHS of the equation by itself). So let $A$ represent the event of having the disease, and $B$ is the event that you tested positive for it. Then look at the RHS of the equation.

$$P(A|B)=\frac{P(B|A)P(A)}{P(B)}$$

$P(B|A)$ is the ptobability of testing positive if you have the disease (this is given in the question).
$P(A)$ is the probability of having the disease, which is given by the occurrence rate in the population.
$P(B)$ is the prob of testing positive which is the fraction of the population that tested positive.

All of this info is given in the question, then simply combine using the formula to get $P(A|B)$.

Part (b) asks you to find $P(B|\neg A)$, for which you actually need the Law of total probability. I will give you a chance to figure out the details.

• Thus, for a), it would be: (0.6*0.03)/0.18, am I right? – Simeon A Apr 24 '18 at 12:55
• Yes, correct. ${}$ – John Doe Apr 24 '18 at 12:57
• For B i got (0.4*0.18)/0.97 = 0.074 – Simeon A Apr 24 '18 at 13:31
• I don't think that is correct. Could you explain what you did? – John Doe Apr 24 '18 at 13:48