Example A patient has complained of certain symptoms. From the experience of doctors, we know that about 5% of people in the same age group have cancer when they complain of the condition. On the other hand, a detailed examination shows a positive reaction of 85% for true cancer patients and a positive reaction of 5 % for non-cancer patients. If a patient gives a positive result on the work-up, find out the probability that the patient has cancer.

Answer Let $A = $「true cancer patient」,$B = $「tested positive by detailed examination. If the patient shows a positive reaction as a result of the detailed examination, the probability of being a cancer patient is calculated. The fact that a patient who shows a positive reaction as a result of a detailed examination is a cancer patient is to find P(cancer patient $\vert$ positive by detailed examination).

  positive negative
cancer patient 0.85 0.15
non cancer patient 0.05 0.95

Here,P(positive by detailed exam $\vert$ cancer patient) = 0.85, P(positive by detailed exam $\vert$ non cancer patient) = 0.05, P(cancer patient) = 0.05

$P(A\vert B)$ is a conditional probability.

$\displaystyle P(A \vert B) = \frac{P(B \cap A)}{P(B)}$

Note that

$\displaystyle B = B \cap \Omega = B \cap (A \cup \bar{A}) = (B \cap A) \cup (B \cap \bar{A})$

By the problem, $P(B \cap A) = P(A \cap B) = P(A)P(B\vert A) = 0.05*0.85, P(B \cap \bar{A}) = P(\bar{A} \cap B) = P(\bar{A})P(B\vert\bar{A}) = 0.95*0.05$. Therefore,

$\displaystyle P(A \vert B)$ $\displaystyle =$ $\displaystyle \frac{P(B \cap A)}{P(B)}$  
  $\displaystyle =$ $\displaystyle \frac{P(B \cap A)}{P(B \cap A) + P(B \cap \bar{A})}$  
  $\displaystyle =$ $\displaystyle \frac{0.05*0.85}{0.05*0.85+0.95*0.05} = \frac{0.425}{0.9}$