Goals

  1. Find and interpret joint and marginal probabilities.
  2. Find and interpret conditional probabilities.
  3. Use the multiplication rule to find the probability of two events occurring together.

Contingency Tables

Last section, we examined the following contingency table.

 

Inoculated

 

yes

no

total

Result

lived

0.0382

0.8252

0.8634

died

0.0010

0.1356

0.1366

total

0.0392

0.9608

1.0000

  • 0.8252 is the proportion of people who lived AND were not inoculated. 
  • 1.000 is the proportion of total number of observations. Think of this as 100% of the observations.
  • 0.0392 is the proportion of people who were inoculated.
  • 0.8634 is the proportion of people who lived.

What can we learn about the result of smallpox if we already know something about inoculation status?

  • For example, given that a person is inoculated, what is the probability of death?
  • To figure this out, we restrict our attention to the 244 inoculated cases. Of these, 6 died. So the probability is 6/244.

Conditional Probability

Conditional probability: the probability of some event \(A\) if we know that event \(B\) occurred (or is true): \[P(A|B) = \frac{P(A\text{ and }B)}{P(B)}\] where the symbol | is read as “given”.

  • For death given inoculation, \[\begin{aligned} P(\text{death}|\text{inoculation}) &= \frac{P(\text{death and inoculation})}{P(\text{inoculation})} \\ &= \frac{0.0010}{0.0392} = 0.0255 \end{aligned}\]
  • We could also write this as \[\begin{aligned} P(\text{death}|\text{inoculation}) &= \frac{P(\text{death and inoculation})}{P(\text{inoculation})} \\ &= \frac{6/6224}{244/6224} = \frac{6}{244} \end{aligned}\]

Independent Events

If knowing whether event \(B\) occurs tells us nothing about event \(A\), the events are independent. For example, if we know that the first flip of a (fair) coin came up heads, that doesn’t tell us anything about what will happen next time we flip that coin.

Multiplication Rule for Independent Processes

If \(A\) and \(B\) are independent events, then \[P(A \text{ and }B) = P(A)P(B).\]

  • We can extend this to more than two events: \[P(A \text{ and }B \text{ and } C \text{ and } \dots) = P(A)P(B)P(C)\dots.\]
  • Note that if \(P(A \text{ and }B) \ne P(A)P(B)\), then \(A\) and \(B\) are not independent.

Example

Find the probability of rolling a \(6\) on your first roll of a die and a \(6\) on your second roll.

Let \(A=\) (rolling a \(6\) on first roll) and \(B=\) (rolling a \(6\) on second roll). For each roll, the probabiltiy of getting a \(6\) is \(1/6\), so \(P(A) = \frac{1}{6}\) and \(P(B) = \frac{1}{6}\).

Then, because each roll is independent of any other rolls, \[P(A \text{ and }B) = P(A)P(B) = \frac{1}{6}\times\frac{1}{6} = \frac{1}{36}\]

General Multiplication Rule

If \(A\) and \(B\) are any two events, then \[P(A \text{ and }B) = P(A|B)P(B).\]

  • This is just the conditional probability formula, rewritten in terms of \(P(A \text{ and }B)\)!

Example

Suppose we know that 45.5% of US households have dogs and that among those with dogs, 12.1% have cats. Find the probability that a US household has both dogs and cats.

Tests for Independence

We can put our idea of independence together with our multiplication rules to come up with three ways to test for independence:

  1. \(P(A|B)=P(A)\)
  2. \(P(B|A)=P(B)\)
  3. \(P(A \text{ and }B) = P(A)P(B)\)

Example

Suppose we know that 45.5% of US households have dogs and that among those with dogs, 12.1% have cats. Additionally, 32.1% of US households have cats. For US households, are having cats and having dogs independent events?

Law of Total Probability

We observed in the last section that we can get a marginal probability by adding up all of its associated joint probabilities in a contingency table.

That is, \[ P(\text{lived}) = P(\text{lived and inoculated}) + P(\text{lived and not inoculated}) \]

Law of Total Probability

We can generalize this for some event \(A\) and some event \(B\) whose \(k\) possible outcomes can be listed as (mutually exclusive) events \(B_1, B_2, \dots B_k\).

Then \[P(A) = P(A \text{ and }B_1) + P(A \text{ and }B_2) + \dots + P(A \text{ and }B_k) \] Using our General Multiplication Rule, we have \(P(A \text{ and }B) = P(A|B)P(B)\), so we can rewrite this as \[P(A) = P(A|B_1)P(B_1) + P(A|B_2)P(B_2) + \dots + P(A|B_k)P(B_k) \]

Bayes’ Theorem

Sometimes, we get some additional information about a probability and we want to update our understanding based on this new information. This the basic idea behind Bayes’ Theorem.

Bayes’ Theorem

  • Our conditional probability rule states that \[P(A|B) = \frac{P(A \text{ and } B)}{P(B)}\]
  • Our multiplication rule that \[P(A \text{ and } B) = P(B \text{ and } A) = P(B|A)P(A)\]
  • Putting these together gives us one last probability rule.
    • (By substituting \(P(B|A)P(A)\) in for \(P(A \text{ and } B)\) in the conditional probability rule)

Bayes’ Theorem

If \(A\) and \(B\) are any two events such that \(P(B)\ne0\), then \[P(A|B) = \frac{P(B|A)P(A)}{P(B)}\]

Example

Consider a test for some rare disease. If you have the disease, this test accurately identifies it 99% of the time. Suppose 0.5% of the population has this disease and the test results in a positive result 8% of the time. Given a positive test result, what’s the probability a person actually has the disease?