Conditional Probability & Independence

Conditioning on B zooms the sample space down to B; A and B are independent exactly when that zoom doesn't change A's share.

By the end you'll be able to compute P(A | B), test independence with P(A∩B) = P(A)P(B), and explain why two mutually exclusive events can't be independent.

Predict first: A starts as "sum is even." Guess — if you now paint B = "first die = 4," will A's odds shift or stay put? Switch to Define B, click the "First die = 4" preset, and check the verdict badge.

The grid is the 36 equally likely outcomes of rolling two dice, (d1, d2). You define both events yourself: pick Define A or Define B below, then click (or press Enter on) grid cells to paint them into that event — a preset button paints the whole shape in one click. The panel recomputes P(A), P(B), P(A∩B), P(A|B), and P(B|A) live, and flags whether A and B are independent.

Paint:

Tip: presets paint the whole event at once; click or press Enter on individual cells to fine-tune whichever event ("Define A" or "Define B") is currently active.

P(A|B) = 0.500
P(A)
0.500
P(B)
1.000
P(A∩B)
0.500
P(A)·P(B)
0.500
P(B|A)
0.500
Independent
in A only in B only in A and B (overlap) in neither

Conditional probability \(P(A \mid B) = P(A \cap B)/P(B)\) for \(P(B) > 0\); events are independent iff \(P(A \cap B) = P(A)P(B)\), equivalently \(P(A \mid B) = P(A)\).

Intuitive

\(P(A \mid B)\) asks: "given that you already know B happened, what fraction of that smaller world also satisfies A?" You call A and B independent when learning B taught you nothing new about A — the fraction of B that's also A equals the fraction of everything that's A.

Formal

The conditional probability is \(P(A \mid B) = \dfrac{P(A \cap B)}{P(B)}\), \(P(B) > 0\). You get independence exactly when \(P(A \cap B) = P(A)\cdot P(B)\) — equivalently \(P(A \mid B) = P(A)\). Rearranging the definition gives the multiplication rule: \(P(A \cap B) = P(A \mid B)P(B) = P(B \mid A)P(A)\).

Applied

Say A = "policyholder has an accident this year" and B = "policyholder is under 25." Actuaries estimate \(P(A \mid B)\) (accident rate given young driver) separately from the overall \(P(A)\), because age and accident risk are not independent — that dependency is exactly what justifies rating classes and age-based premiums.

Worked example
Roll one die. \(A\) = "even" = \(\{2,4,6\}\), \(B\) = "\(\ge 4\)" = \(\{4,5,6\}\). \(A \cap B = \{4,6\}\). \(P(A \mid B) = (2/6)/(3/6) = \) 2/3, which \(\ne P(A) = 1/2\), so A and B are not independent.
Your turn — finish the last step

Roll one die. \(A\) = "even" = \(\{2,4,6\}\), \(B\) = "\(\le 2\)" = \(\{1,2\}\). Follow the same steps as above:

1. \(A \cap B = \{2\}\), so \(P(A \cap B) = 1/6\).
2. \(P(B) = 2/6\).
3. \(P(A \mid B) = P(A \cap B) / P(B) = (1/6)/(2/6) = \) ?

Reveal step 3

\(P(A \mid B) = (1/6)/(2/6) = 1/2\), which equals \(P(A) = 1/2\) — so this time A and B are independent. Same recipe as the worked example, different verdict: always compare \(P(A \mid B)\) to \(P(A)\), don't guess from the shape of the sets.

One classic trap worth flagging before the quiz: two events with positive probability that are mutually exclusive are never independent. If A ruling out B (and vice versa) sounds like "no relationship," it's actually the strongest possible relationship — knowing one occurred tells you the other definitely didn't.

More info — the same idea as a frequency table

Instead of set notation, picture a two-way frequency table of 600 people crossed by two yes/no traits, A and B. \(P(A \mid B)\) is just "of the people in the B column, what fraction are also in the A row?" — a plain ratio of table cells, no formula required. Independence means every column of the table has the same row proportions; if the B column looks different from the "everyone" column, A and B are dependent. This is the same zooming idea as the interactive above, just drawn as a table instead of a grid of dice outcomes. See the Khan Academy tutorial on checking independence for worked table examples.

Check your understanding

Question 1 of 4

A die is rolled once. Let A = 'result is even' and B = 'result is at least 4'. What is P(A | B)?

Question 2 of 4

Events A and B each have positive probability and are mutually exclusive (P(A ∩ B) = 0). Are A and B independent?

Question 3 of 4

A box has 3 red and 2 blue balls. Two balls are drawn without replacement, so there are C(5,2) = 10 equally likely pairs. Let A = 'both balls are red' and B = 'at least one ball is red'. What is P(A | B)?

Question 4 of 4

A and B are independent with P(A) = 0.4 and P(B) = 0.3. Using inclusion–exclusion (gp.axioms), what is P(A ∪ B)?

Recap

  • \(P(A \mid B) = P(A \cap B)/P(B)\) for \(P(B) > 0\) — conditioning zooms the sample space down to B.
  • A and B are independent iff \(P(A \cap B) = P(A)P(B)\), equivalently \(P(A \mid B) = P(A)\) — knowing B changed nothing about A.
  • Multiplication rule: \(P(A \cap B) = P(A \mid B)P(B) = P(B \mid A)P(A)\).
  • Mutually exclusive events with positive probability are never independent — that's a favorite exam trap.

Dive deeper

Sources

  • Conditional Probability and Independence