I am studying from the book A modern introduction to Probability and Statistics, by F.M. Dekking et al. I have a problem with this exercise on conditional probability (Ex. 3.16 from Chapter 3):
You are diagnosed with an uncommon disease. You know that there only is a $1$% chance of getting it. Use the letter $D$ for the event “you have the disease” and $T$ for “the test says so.” It is known that the test is imperfect: $P(T\mid D) = 0.98$ and $P(T^c \mid D^c) = 0.95$.
a. Given that you test positive, what is the probability that you really have the disease?
b. You obtain a second opinion: an independent repetition of the test. You test positive again. Given this, what is the probability that you really have the disease?
My attempt:
a. I know from the text that $P(D)=0.01$, furthermore, because $P(\cdot \mid D^c)$ is a probability, I have that $$P(T \mid D^c) = 1 - P(T^c \mid D^c) = 0.05$$ so I can compute $P(D\mid T)$ by Bayes' formula: $$P(D\mid T) = \frac{P(T\mid D)P(D)}{P(T)}$$ Next I use the law of total probability to compute $P(T)$: $$P(T) = P(T\mid D)P(D) + P(T\mid D^c)P(D^c)=0.98\cdot 0.01 + 0.05\cdot 0.99 = 0.0593$$ so that $$P(D\mid T) = \frac{P(T\mid D)P(D)}{P(T)}=\frac{0.98\cdot 0.01}{0.0593}\simeq 0.1653$$
b. Here I don't know how to formalize the solution. I'd put sloppily $$T_1 = \text{the first repetition of the test is positive}$$ and $$T_2 = \text{the second repetition of the test is positive}$$ so I think I have to compute the conditional probability $$P(D\mid T_1\cap T_2)=\frac{P(D\cap T_1\cap T_2)}{P(T_1\cap T_2)}.$$ Now, I think that by the independence of the two repetitions of the test I can safely assume that $$P(T_1\cap T_2) = P(T)^2.$$ But how to compute $P(D\cap T_1\cap T_2)$? And there is a way to better formalize the solution?
Thanks in advance for your help!
It's a very standard exercise
The probabilty to have a positive test is
$$P(T)=0.01\times0.98+0.05\times0.99=0.0593$$
Thus
$$P(D|T)=\frac{0.01\times0.98}{0.01\times0.98+0.05\times0.99}\approx 16.53\%$$
If you have two consecutive independent positive tests you probability increases
$$P(D|TT)=\frac{0.01\times0.98^2}{0.01\times0.98^2+0.05^2\times0.99}\approx 79.51\%$$