Skip to content
Part IA Easter Term

Bayes' Theorem and Independence

Bayes’ Theorem Review

P(FE)=P(EF)P(F)P(E)P(F \mid E) = \frac{P(E \mid F) \cdot P(F)}{P(E)}

This lets us reverse the direction of conditioning: from P(EF)P(E \mid F) to P(FE)P(F \mid E).

Computational Form

With partition F1,,FnF_1, \ldots, F_n:

P(FiE)=P(EFi)P(Fi)j=1nP(EFj)P(Fj)P(F_i \mid E) = \frac{P(E \mid F_i) \cdot P(F_i)}{\sum_{j=1}^{n} P(E \mid F_j) \cdot P(F_j)}

The denominator is the law of total probability applied to P(E)P(E).

Example: Spam Filtering

An email contains the word “free”. Historical data shows:

  • P("free"spam)=0.3P(\text{"free"} \mid \text{spam}) = 0.3
  • P("free"not spam)=0.05P(\text{"free"} \mid \text{not spam}) = 0.05
  • P(spam)=0.4P(\text{spam}) = 0.4

P(spam"free")=0.3×0.40.3×0.4+0.05×0.6=0.120.12+0.03=0.120.15=0.8P(\text{spam} \mid \text{"free"}) = \frac{0.3 \times 0.4}{0.3 \times 0.4 + 0.05 \times 0.6} = \frac{0.12}{0.12 + 0.03} = \frac{0.12}{0.15} = 0.8

An email with “free” has 80% probability of being spam.

Independence of Events

Definition

Events EE and FF are independent if:

P(EF)=P(E)P(F)P(E \cap F) = P(E) \cdot P(F)

Equivalently (when P(F)>0P(F) > 0):

P(EF)=P(E)P(E \mid F) = P(E)

Knowing FF occurred gives no information about EE.

Intuition

Two events are independent if the occurrence of one tells us nothing about the occurrence of the other. The probability of EE is the same whether or not we know FF occurred.

Example: Coin Flips

Flip a fair coin twice. Let EE = “first is heads”, FF = “second is heads”.

P(EF)=P(HH)=14=12×12=P(E)P(F)P(E \cap F) = P(HH) = \frac{1}{4} = \frac{1}{2} \times \frac{1}{2} = P(E) \cdot P(F)

The outcomes are independent.

Example: Dependent Events

Draw two cards without replacement. Let EE = “first is ace”, FF = “second is ace”.

P(EF)=452351=122652452452P(E \cap F) = \frac{4}{52} \cdot \frac{3}{51} = \frac{12}{2652} \neq \frac{4}{52} \cdot \frac{4}{52}

Not independent: drawing an ace first changes the probability of drawing an ace second.

Independent vs Mutually Exclusive

Common confusion: Independence and mutual exclusivity are different concepts.

PropertyE,FE, F disjoint (ME)E,FE, F independent
Defining equationEF=E \cap F = \emptysetP(EF)=P(E)P(F)P(E \cap F) = P(E) P(F)
ProbabilityP(EF)=0P(E \cap F) = 0P(EF)=P(E)P(F)>0P(E \cap F) = P(E) P(F) > 0 typically
Knowing FF occurredEE cannot occurGives no info about EE

Key insight: If EE and FF are both possible (positive probability) and mutually exclusive, they are NOT independent. Knowing FF occurred tells us EE did NOT occur.

Mutual Independence

Pairwise Independence

Events E1,E2,,EnE_1, E_2, \ldots, E_n are pairwise independent if EiE_i and EjE_j are independent for all iji \neq j.

This is weaker than mutual independence.

Mutual Independence

Events E1,E2,,EnE_1, E_2, \ldots, E_n are mutually independent if for every subset S{1,2,,n}S \subseteq \{1, 2, \ldots, n\}:

P(iSEi)=iSP(Ei)P\left(\bigcap_{i \in S} E_i\right) = \prod_{i \in S} P(E_i)

Important: Pairwise independence does NOT imply mutual independence.

Example: Pairwise but Not Mutual

Flip two fair coins. Define:

  • AA = first coin is heads
  • BB = second coin is heads
  • CC = coins match (both heads or both tails)

Check independence:

  • P(A)=P(B)=P(C)=12P(A) = P(B) = P(C) = \frac{1}{2}
  • P(AB)=14=P(A)P(B)P(A \cap B) = \frac{1}{4} = P(A) P(B) (pairwise independent)
  • P(AC)=14=P(A)P(C)P(A \cap C) = \frac{1}{4} = P(A) P(C) (pairwise independent)
  • P(BC)=14=P(B)P(C)P(B \cap C) = \frac{1}{4} = P(B) P(C) (pairwise independent)

But:

  • P(ABC)=14P(A \cap B \cap C) = \frac{1}{4} (only HH)
  • P(A)P(B)P(C)=18P(A) P(B) P(C) = \frac{1}{8}

These events are pairwise independent but NOT mutually independent.

Conditional Independence

Events EE and FF are conditionally independent given GG if:

P(EFG)=P(EG)P(FG)P(E \cap F \mid G) = P(E \mid G) \cdot P(F \mid G)

Events can be independent unconditionally but dependent conditionally, or vice versa.

Example: Berger’s Bullets

Two shooters aim at a target. Let A,BA, B be “shooter A/B hits”. Unconditionally, AA and BB might be independent. But given the target is hit, knowing AA missed makes it more likely BB hit, creating dependence.

Properties of Independence

  1. If EE and FF are independent, then so are EE and FcF^c.

    Proof: P(E)=P(EF)+P(EFc)=P(E)P(F)+P(EFc)P(E) = P(E \cap F) + P(E \cap F^c) = P(E) P(F) + P(E \cap F^c), so P(EFc)=P(E)P(E)P(F)=P(E)(1P(F))=P(E)P(Fc)P(E \cap F^c) = P(E) - P(E) P(F) = P(E)(1 - P(F)) = P(E) P(F^c).

  2. If EE and FF are independent, then EcE^c and FcF^c are independent.

  3. Independence is symmetric: EE independent of FF iff FF independent of EE.

Application: System Reliability

Components in series all must work. If each has reliability pp and failures are independent:

P(system works)=pnP(\text{system works}) = p^n

Components in parallel: at least one must work:

P(system works)=1(1p)nP(\text{system works}) = 1 - (1-p)^n

Summary

ConceptDefinition
IndependenceP(EF)=P(E)P(F)P(E \cap F) = P(E) P(F)
Equivalent formP(EF)=P(E)P(E \mid F) = P(E) (when P(F)>0P(F) > 0)
Mutual independenceP(iSEi)=iSP(Ei)P(\bigcap_{i \in S} E_i) = \prod_{i \in S} P(E_i) for all subsets SS
Conditional independenceP(EFG)=P(EG)P(FG)P(E \cap F \mid G) = P(E \mid G) P(F \mid G)