I have this question.
Suppose that there is a method to detect cancer with the property that $90\%$ of people with cancer reacts positive, while the $5\%$ of those who don't have cancer reacts positive. Suppose that the $1\%$ of a population has cancer. Calculate the probability that a random person selected from that population has cancer and tests positive.
My try was:
$\text{A}=\text{Reacts positive, } \text{B}=\text{Has cancer}$
$$P(A\mid B)=\frac{P(A\cap B)}{P(B)}=\frac{P(B\mid A) P(A)}{P(B)}$$
I know that
$$P(B)=0.01,\ \ P(A)=(0.99)(0.05)+(0.01)(0.90)=0.0585$$
and by hypothesis $P(B\mid A)=.90$
So the answer must be: $$\frac{P(B\mid A) P(A)}{P(B)}=\frac{(.90)(.01)}{.0585}=\frac{9}{585}=\frac{1}{65}$$
Is it correct?
If you are asking about the probability that a random person tests positive AND has cancer, you are looking for:
\begin{align*} P(A \cap B ) = P(A|B)P(B) = 0.9 \times 0.01 = 0.09 \end{align*}
if instead you are asking the probability that someone has cancer given they tested positive:
\begin{align*} P(B | A ) &= \frac{P(A \cap B)}{P(A)}\\ & = \frac{P(A|B)P(B)}{P(A)}\\ & = \frac{P(A|B)P(B)}{P(A|B)P(B) + P(A|\bar{B})P(\bar{B})}\\ &=\frac{0.9 \times 0.01}{0.9 \times 0.01 + 0.05 \times 0.99} \end{align*}