The probability of having HIV for someone who tests positive

bayes-theoremconditional probabilitydiscrete mathematicsprobabilityprobability theory

Assume one person out of 10,000 is infected with HIV, and there is a test in which 2.5%
of all people test positive for the virus although they do not really have it. If you test
negative on this test, then you definitely do not have HIV. Let H be the event of having
HIV and T be the event of testing positive. Find the following.

(a) Pr(T|H), the probability of testing positive for someone with HIV.

(b) Pr(H ∩ T), the probability of having HIV and testing positive.

(c) Pr(T|H'), the probability of testing positive for someone without HIV.

(d) Pr(H'∩ T), the probability of not having HIV and testing positive.

(e) Pr(T), the probability of testing positive.

(f) Pr(H|T), the probability of having HIV for someone who tests positive.

I already get Pr(H) = 0.0001, Pr(H') = 0.9999 ,Pr(T|H')= 0.025 ,
Pr(H|T)= 0.0395 -Calcaluted with bayes theorem
Now the question is how to do part (b) , part (d), and part (e)

Best Answer

enter image description here

p:  HIV prevalance (ignoring prior risk factors)
v:  test sensitivity
f:  test specificity
H:  HIV-positive
H':  HIV-negative
+:  Positive test result
-:  Negative test result

We are given that \begin{align}p&=0.0001,\\1-f=0.025,\text{ i.e., }f&=0.975\\v&=1.\end{align}

Referring to the above probability tree and given values,

(a) Pr(T|H)

$P(T|H)=v$

(b) Pr(H ∩ T)

$P(H ∩ T)=pv$

(d) Pr(H'T)

$P(H'∩ T)=(1-p)(1-f)$

(e) P(T)

$P(T)=P(H∩T)+P(H'∩T)$

(f) Pr(H|T)

Pr(H|T)= 0.0395

\begin{aligned}P(H|T)&=\frac{P(H∩T)}{P(H∩T)+P(H'∩T)}\\&=\frac{pv}{pv+(1-p)(1-f)}\\&=0.398\%.\end{aligned} (How did you obtain your derived value? It differs from mine.)

More information here: The accuracy of a medical test.