2.7 - Bayes' Theorem

Example 2-10: Jury Trial Section

In a jury trial, suppose the probability the defendant is convicted, given guilt, is 0.95, and the probability the defendant is acquitted, given innocence, is 0.95. Suppose that 90% of all defendants truly are guilty. Find the probability the defendant was actually innocent given the defendant is convicted. The video will step you through this example.

Video: Jury Trial Example

Answer

Let Guilty = \(G\)
Innocent = \(I\)
Acquitted = \(A\)
Convicted = \(C\)

\(P(G) = 0.9\) so \(P(I) = 0.1\)
\(P(C | G) = 0.95\) so \(P(A | G) = 0.05\)
\(P(A | I) = 0.95\) so \(P(C | I) = 0.05\)
Need to find: \(P(I | C)\)

\begin{align} P(I\ and\ C)  &= P(C | I)*P(I)\\ &= 0.05*0.1\\ &= 0.005 \end{align}
\begin{align} P(C) &= P(G\ and\ C) + P(I\ and\ C)\\ &= (0.95)*(0.9) + ( 0.05)*(0.1)\\ &= 0.855 + 0.005\\ &= 0.86\\ \end{align}
\begin{align} P(I | C) &= \dfrac{P(I\ and\ C) }{P(C)} \\&= \dfrac{0.005}{0.86}\\ &= 0.006 \end{align}

The above example illustrates the use of Bayes' theorem to find "reverse" conditional probabilities.

Bayes' Theorem

Suppose we have events $A_1, \dots, A_k$  and event B.  If $A_1, \dots, A_k$ are $k$ mutually exclusive events, then...

\( P(A_{i}|B)=\dfrac{P(B | A_{i})P(A_{i})}{\sum_{i} P(B | A_{i})P(A_{i})}=\dfrac{P(B | A_{i})P(A_{i})}{P(B| A_{1})P(A_{1})+P(B |A_{2})P(A_{2})+...+P(B| A_{k})P(A_{k})}\)

Applying this to just two events A and B we have...

\( P(A|B)=\dfrac{P(B | A)P(A)}{ P(B | A)P(A)+P(B| A')P(A')}\)

Example 2-11: Screw Manufacturing Section

A company creates their product using a specially made screw. For financial purposes, the company gets their screws from three different manufacturers. If a screw is defective, it can cause a lot of damage. Here is the table of the proportion of screws from each manufacturer and the probability of obtaining a defective screw.

Manufacturer Probability of Company's Screws Probability of Defective Screw
A 0.40 0.01
B 0.25 0.02
C 0.35 0.015

If a screw is found to be defective, what is the probability that it came from Manufacturer C?

Answer

Let D denote a defective screw.  We want \(P(C|D)\).  We can use Bayes' Theorem to find this probability.

\begin{align} P(C|D) &=\frac{P(C\cap D)}{P(D)}\\ &=\frac{P(D|C)P(C)}{P(D|C)P(C)+P(D|A)P(A)+P(D|B)P(B)}\\ &=\frac{0.015(0.35)}{0.015(0.35)+0.01(0.40)+0.02(0.25)}\\ &=\frac{0.00525}{0.01425}\\ &=\frac{7}{19}=0.36842 \end{align}

Practical Application: Bayes' Theorem in Diagnostic Testing Section

In diagnostic testing (e.g. drug tests), there are five key concepts:

Prevalence

Prevalence is the probability or proportion of occurrence of a disease or behavior in the population at a particular point in time.

  • Example: Proportion of bus drives who use illegal drugs
Sensitivity and Specificity
  • Sensitivity is the probability of a positive result given person is actually positive.
    • Example: the probability of a home pregnancy test coming up positive for a woman who is actually pregnant
  • Specificity is the probability of a negative result given person is actually negative.
    • Example: the probability of a home pregnancy test coming up negative for a woman who is not pregnant
False Positives and False Negatives
  • False Positives are when results come back positive for someone who is actually negative
    • Example: a home pregnancy test coming up positive for a woman who is not pregnant
  • False Negatives are when results come back negative for someone who is actually positive
    • Example: a home pregnancy test coming up negative for a woman who is actually pregnant

Example 2-12: Diabetes Screening Section

Consider the following data on a diabetes screening test based on a non-fasting blood screen test, which is relatively inexpensive and painless.

Test Results
Diabetes? Positive Negative Total
Yes 350 150 500
No 1900 7600 9500
Total 2250 7750 10,000

Answer

With these results, we see the Sensitivity is 350 out of 500 or 70% and the specificity is 7600 out of 9500 or 80%. The overall prevalence of diabetes is 500 out of 10000 or 5%.

From this test, how many were “missed” (i.e. actually had diabetes – the false negatives) and how many were incorrectly identified as having the disease (i.e. false positives).

The test missed identifying 150 (a false negative rate of 150/500 or 30%) while the false positive rate was 1900/9500 or 20%. 

We can see the importance of getting second opinions. What happens with the second opinion (or second test) is that a more expensive and accurate test is used (e.g. a clinical test for pregnancy or a glucose tolerance test for diabetes that requires fasting and a day at a clinic/hospital/doctor’s office). These additional tests are done to verify results before continuing with what can be expensive and uncomfortable treatments.