2.10 Bayes’ rule

By the definition of conditional probability

\[ \text{P}(A \mid B)=\frac{\text{P}(A \cap B)}{\text{P}(B)} \]

By the multiplication rule

\[ \text{P}(A \cap B) = \text{P}(A) \cdot \text{P}(B \mid A) \]

Then, we have

\[ \text{P}(A \mid B)=\frac{\text{P}(A) \cdot \text{P}(B \mid A)}{\text{P}(B)} \]

Bayes’ rule

Let \(A_1, A_2, \cdots, A_n\) form a partition of sample space \(\Omega\).

Then, for any event \(B\) such that \(\text{P}(B)>0\), we have

\[ \text{P}(A_i \mid B) = \frac{\text{P}(A_i) \cdot \text{P}(B \mid A_i)}{\text{P}(B)} \]

\[\text{where}\]

\[ \small{\text{P}(B) = \text{P}(A_1) \cdot \text{P}(B \mid A_1) + \cdots + \text{P}(A_n) \cdot \text{P}(B \mid A_n)} \]

The false positive puzzle

  • 1 in 1,000 people is afflicted with a rare disease for which a diagnostic test has been developed.
  • When an individual has the disease, it would test positive (i.e., state disease present) 99% of the time.
  • When an individual does not have the disease, it would test negative 98% of the time.
  • A person just tested positive.
  • What is the chance this person has the disease?

Signal detection theory


Test positive Test negative
Target present True positive
\(a\)
False negative
\(b\)
Target absent False positive
\(c\)
True negative
\(d\)

Test positive Test negative
Target present True positive
\(a\)
False negative
\(b\)
Target absent False positive
\(c\)
True negative
\(d\)

\[ \begin{aligned} \text{sensitivity (or recall)}&=\frac{a}{a+b} \\ \\ \text{specificity}&=\frac{d}{c+d} \\ \end{aligned} \]

Let’s define the following events

  • \(A\): Someone has the disease.
  • \(A^c\): Someone does not have the disease.
  • \(B\): Someone tested positive.
  • \(B^c\): Someone tested negative.

A person just tested positive.

What is the chance this person has the disease?

Exercise

  • We were given three coins.
    • One is regular.
    • One has heads in both faces.
    • One has tails in both faces.
  • Without looking at it, we chose a coin at random and tossed it. It landed on heads.
  • What is the probability that the opposite is tails?