I've been doing this question but I'm a little stuck on the second part. The first part is as follows:
The probability of a randomly selected person in a population having a particular genetic trait is 0.00001. A test for this trait successfully detects it, if present, 99.9% of the time, and only returns a false positive 0.1% of the time. A person tests positive for the trait. Find the probability that they actually have the genetic trait. Give your answer to 3 significant figures.
To approach this problem, I defined the following events: A - the person has the genetic trait and B - the test detects the trait.
Based on the information in the question, we have: $$P(A)=0.00001$$ $$P(B|A)=0.999$$ $$P(B|!A)=0.001$$
The question asks for $P(A|B)$ and so I thought to apply Bayes: $$P(A|B)=\frac{P(B|A)P(A)}{P(B)}$$
To find $P(B)$, I used the total probability: $$P(B)=P(B|A)P(A)+P(B|!A)P(!A)$$
Substituting in the values, I got $P(A|B)=0.00989$ to 3 significant figures. The second part goes like this:
In order to improve accuracy, individuals are instructed to take the test twice, regardless of the result of the first test. What is the probability that an individual receives a positive result from both tests? Give your answer to 3 significant figures. Find the probability, given that they have tested positive twice, that they actually have the genetic trait. Give your answer to 3 significant figures.
I'm not quite sure how to formulate this problem in terms of the events I defined previously.
Let $A,B$ be defined as before but with $B$ specifically being in reference to the results of the first test. Let $C$ be defined similarly to $B$ but with $C$ being in reference to the results of the second test.
Let us assume that the question author intends that a person who takes the test who has the condition gets the results of the two tests independently of one another... similarly for someone who does not have the condition. That is... $\Pr(B)=\Pr(C),~\Pr(B\mid A)=\Pr(C\mid A),~\Pr(B\mid \neg A)=\Pr(C\mid \neg A)$ and that $\Pr(B\cap C\mid A)=\Pr(B\mid A)\Pr(C\mid A)$ as well as $\Pr(B\cap C\mid \neg A)=\Pr(B\mid \neg A)\Pr(C\mid \neg A)$. Admittedly, this is a very heavy assumption which is generally not going to be true in practice, but without this assumption it makes no sense to try to repeat the test and expect that it will improve accuracy.
Let us try to find the probability that a randomly selected person (ignoring whether they have the condition or not) tests positive twice in a row. That would be $\Pr(B\cap C)$ but recall that $B$ and $C$ will not be independent, merely conditionally independent... so we may not simply expand as $\Pr(B\cap C)=\Pr(B)\Pr(C)$. We approach instead by the law of total probability and expand by using $A$ and what we know (and assumed).
$\begin{array}{rll}\Pr(B\cap C) &= \Pr(B\cap C\mid A)\Pr(A)+\Pr(B\cap C\mid \neg A)\Pr(\neg A)&\text{by total probability}\\&=\Pr(B\mid A)\Pr(C\mid A)\Pr(A)+\Pr(B\mid\neg A)\Pr(C\mid \neg A)\Pr(\neg A)&\text{by assumption}\\&=0.999\cdot 0.999\cdot 0.00001 + 0.001\cdot 0.001\cdot 0.99999&\text{plugging in numbers}\\&=0.00001097001&\text{evaluate}\end{array}$
Now, we wish to find $\Pr(A\mid (B\cap C))$. To do this, we do as before by Bayes' Theorem.
$$\begin{array}{rll}\Pr(A\mid (B\cap C)) &= \dfrac{\Pr(B\cap C\mid A)\Pr(A)}{\Pr(B\cap C)}&\text{by Bayes'}\\&=\dfrac{\Pr(B\mid A)\Pr(C\mid A)\Pr(A)}{\Pr(B\cap C)}&\text{by assumption}\\&=\dfrac{0.999\cdot 0.999\cdot 0.00001}{0.00001097001}&\text{plugging in}\\&\approx 0.90975395646859\dots&\text{evaluate}\end{array}$$