Home › Probability › Lesson 2

Conditioning, Bayes' Theorem and Independence

Lesson 2 of 12

Key idea of this section

P(A | B) = P(A ∩ B) / P(B),     P(Bₖ | A) = P(A | Bₖ) P(Bₖ) / ∑ⱼ P(A | Bⱼ) P(Bⱼ)
A, B independent  ⇔  P(A ∩ B) = P(A) P(B)

Conditional probability as a new measure

Definition 2.1. If P(B) > 0, the conditional probability of A given B is P(A | B) = P(A ∩ B) / P(B).

For fixed B, the map A ↦ P(A | B) is itself a probability measure on (Ω, 𝓕), concentrated on B. Thus every theorem about probability measures applies to conditional probabilities. The definition rearranges to the multiplication rule P(A ∩ B) = P(A | B) P(B), and by induction

P(A₁ ∩ ⋯ ∩ Aₙ) = P(A₁) P(A₂ | A₁) P(A₃ | A₁ ∩ A₂) ⋯ P(Aₙ | A₁ ∩ ⋯ ∩ Aₙ₋₁)

whenever the conditioning events have positive probability.

Theorem 2.2 (law of total probability and Bayes' theorem). Let B₁, B₂, … be a finite or countable partition of Ω into events of positive probability. Then for every event A,

P(A) = ∑ⱼ P(A | Bⱼ) P(Bⱼ)

and, if P(A) > 0,

P(Bₖ | A) = P(A | Bₖ) P(Bₖ) / ∑ⱼ P(A | Bⱼ) P(Bⱼ)

Proof. A is the disjoint union of the sets A ∩ Bⱼ, so countable additivity and the multiplication rule give the first formula. The second is P(Bₖ ∩ A)/P(A) with numerator and denominator rewritten by the multiplication rule and the first formula. ∎

In Bayesian language, P(Bₖ) is the prior, P(A | Bₖ) the likelihood and P(Bₖ | A) the posterior. Bayes' theorem is often clearest in odds form: posterior odds equal prior odds times the likelihood ratio,

P(B | A) / P(Bᶜ | A) = [P(B) / P(Bᶜ)] · [P(A | B) / P(A | Bᶜ)]

Worked example 2.3. A condition has prevalence 1%. A test detects it with probability 0.99 (sensitivity) and gives a false positive with probability 0.05. Given a positive test, the probability of the condition is

P(D | +) = (0.99)(0.01) / [(0.99)(0.01) + (0.05)(0.99)] = 0.0099 / 0.0594 = 1/6 ≈ 0.167

The prior odds 1 : 99 multiplied by the likelihood ratio 0.99/0.05 = 19.8 give posterior odds 19.8 : 99 = 1 : 5, the same answer. The low posterior despite an accurate test is the base-rate effect, and ignoring it is the base-rate fallacy.

Independence of events

Definition 2.4. Events A₁, …, Aₙ are (mutually) independent if P(⋂i∈S Aᵢ) = ∏i∈S P(Aᵢ) for every subset S ⊆ {1, …, n}. An infinite family is independent if every finite subfamily is.

Pairwise independence is strictly weaker. Toss two fair coins and let A = {first is heads}, B = {second is heads}, C = {the two coins agree}. Each event has probability 1/2 and each pair intersects in a single outcome of probability 1/4, so the three are pairwise independent. But A ∩ B ∩ C = A ∩ B has probability 1/4 ≠ 1/8, so they are not mutually independent. Note also that if A and B are independent then so are A and Bᶜ, Aᶜ and B, and Aᶜ and Bᶜ.

Independence of σ-algebras

Definition 2.5. Sub-σ-algebras 𝓖₁, …, 𝓖ₙ of 𝓕 are independent if P(G₁ ∩ ⋯ ∩ Gₙ) = P(G₁) ⋯ P(Gₙ) whenever Gᵢ ∈ 𝓖ᵢ. Random variables are independent when the σ-algebras they generate are.

Checking the definition on every set of a σ-algebra is impractical. The π–λ theorem reduces it to generators.

Lemma 2.6. If 𝓟₁, …, 𝓟ₙ are π-systems with Ω ∈ 𝓟ᵢ and P(P₁ ∩ ⋯ ∩ Pₙ) = ∏ P(Pᵢ) whenever Pᵢ ∈ 𝓟ᵢ, then σ(𝓟₁), …, σ(𝓟ₙ) are independent.

Proof. Fix P₂, …, Pₙ. Both sides of the product identity, regarded as functions of the first set, are finite measures that agree on 𝓟₁; the sets where they agree form a λ-system, so by Dynkin's theorem they agree on σ(𝓟₁). Repeat for each coordinate in turn. ∎

In particular, real random variables X₁, …, Xₙ are independent if and only if P(X₁ ≤ x₁, …, Xₙ ≤ xₙ) = ∏ P(Xᵢ ≤ xᵢ) for all real x₁, …, xₙ. A further consequence is grouping: if a family of independent σ-algebras is split into disjoint blocks, the σ-algebras generated by the blocks are independent. Functions of disjoint groups of independent variables are therefore independent.

The Borel–Cantelli lemmas

For a sequence of events, the event that infinitely many occur is:

{Aₙ i.o.} = lim sup Aₙ = ⋂m≥1 ⋃n≥m Aₙ

Theorem 2.7 (first Borel–Cantelli lemma). If ∑ₙ P(Aₙ) < ∞, then P(Aₙ i.o.) = 0.

Proof. For every m, P(lim sup Aₙ) ≤ P(⋃n≥m Aₙ) ≤ ∑n≥m P(Aₙ), the tail of a convergent series, which tends to 0. ∎

Theorem 2.8 (second Borel–Cantelli lemma). If the Aₙ are independent and ∑ₙ P(Aₙ) = ∞, then P(Aₙ i.o.) = 1.

Proof. It suffices to show that P(⋂n≥m Aₙᶜ) = 0 for every m. By independence and continuity from above, and the inequality 1 − x ≤ e−x,

P(⋂n=mN Aₙᶜ) = ∏n=mN (1 − P(Aₙ)) ≤ exp(−∑n=mN P(Aₙ)) → 0 as N → ∞

so the intersection over all n ≥ m is null. A countable union of null events is null, so P(⋃ₘ ⋂n≥m Aₙᶜ) = 0, which is the complement of {Aₙ i.o.}. ∎

Together the lemmas give a zero–one law: for independent events, P(Aₙ i.o.) is 0 or 1 according as ∑ P(Aₙ) converges or diverges. For example, in an infinite sequence of fair coin tosses, let Bₖ = {tosses 2ᵏ through 2ᵏ + k − 1 are all heads}. The blocks of tosses are disjoint, so the Bₖ are independent, and P(Bₖ) = 2⁻ᵏ is summable: almost surely only finitely many Bₖ occur. If instead the block starting at toss 2ᵏ has length ⌊log₂ k⌋, its probability 2−⌊log₂ k⌋ is at least 1/k, the series diverges, and such runs of heads occur infinitely often almost surely. Independence cannot be dropped in Theorem 2.8: with A₁ = A₂ = ⋯ = A and P(A) = 1/2 the series diverges but P(Aₙ i.o.) = 1/2.

Exercise

  • (a)
    Urn I contains 3 red and 2 blue balls; urn II contains 1 red and 4 blue. An urn is chosen by a fair coin and a ball drawn from it is red. Find the posterior probability that urn I was chosen.
  • (b)
    Let Aₙ be independent with P(Aₙ) = 1/n. What is P(Aₙ i.o.)? What if P(Aₙ) = 1/n² (independence no longer needed)?
  • (c)
    Show that an event A is independent of itself if and only if P(A) ∈ {0, 1}.
Show solution

Answers: (a) P(I | red) = (1/2)(3/5) / [(1/2)(3/5) + (1/2)(1/5)] = 3/4. (b) ∑ 1/n = ∞, so P(Aₙ i.o.) = 1 by the second lemma; ∑ 1/n² = π²/6 < ∞, so P(Aₙ i.o.) = 0 by the first. (c) Independence of A with itself means P(A) = P(A)², whose only solutions are 0 and 1.

V.3.1