A question from total probability theorem and Bayes theorem A doctor recommends a test for a particular disease for a patient having a symptom. Before the results of the test, the only evidence the doctor has to go on is that 10% having this symptom has the disease. Past experience has shown that in 99% of the cases in which disease is present the test reveals the presence of the disease. In 95% of the cases in which disease is not present test reveals the absence of the disease.
What is the probability that the test reveals the presence of the disease?
If the test reveals that the disease is present, what is the probability that the patient is actually having the disease?
Following shows how I answered the question
[ H denotes the patient is having the disease,
N denotes the patient doesn't have the disease,
D denotes the test results]
P(D)=P(H).P(D/H)+P(N).P(D/N)
$=0.1*0.99+0.9*0.95
    =0.099+0.855
     =0.954$
Then, P(H/D)=( P(H).P(D/H))÷P(D)
$=0.99/0.954
                   =99/954$
Even though I answered, I don't know whether I have taken the correct approach.
So I need help to understand the question properly and how to do it.
 A: No, you have not used correct value of $P(D/N)$ which would be $0.05,\;\; not\;\; 0.95$
However, it is so much less confusing for beginners to use  Bayes' Theorem in a more commonsense manner.
Out of $1000$ people, $100$ are expected to have the disease of which $100*0.99 = 99$ would test positive,
and from the $900$ non-diseased, $900*0.05 = 45$ would test positive
Thus P(has disease|tested positive) $=\dfrac{99}{144}$
A: We are given that
$$P(D)=0.1,\\
P(+|D)=0.99,\\
P(-|D^c)=0.95,$$ where the $+$ and $-$ signs refer to test result, while $D$ and $D^c$ stand for Diseased and Not Diseased, respectively.




*If the test reveals that the disease is present, what is the probability that the patient is actually having the disease?



The answer is technically $100\%,$ since the test has already revealed that the patient has the disease. But of course, what the author actually means is that the test result is positive. As such, the answer is asking for $P(D|+)$ (see below).



*

*What is the probability that the test reveals the presence of the disease?



The above poor phrase usage suggests that the author is here asking for $P(+).$ On the other hand, the interpretations $P(+|D)$ and $P(D\cap+)$ are also plausible.

*

*$P(+|D)$ is given above

*$P(D\cap+)=P(D)\times P(+|D)=0.1\times0.99 = 0.099$

*$P(+)=P(D\cap+)+P(D^c\cap+) = 0.099+P(D^c)\times P(+|D^c)=\ldots$


*

*$\displaystyle P(D|+)=\frac{P(D\cap+)}{P(D\cap+)+P(D^c\cap+)}=\frac{0.099}{0.099+P(D^c)\times P(+|D^c)}=\dots.$
Read more here.
