Join · scan

OTTO-PR2

ottolearn.org/join

Module 2 · Probability Foundations · PR-2

Conditional Probability
"One bad night causes the next — doesn't it?"

Maya's reply runs, and the reader writes back within the hour: "Fair enough — my nights aren't coin flips. But that's my point: one bad night causes the next. That's not chance, that's a chain." Last class's coin had no memory. Maybe sleep does. Today: the mathematics of given — how to measure whether knowing one thing changes the chances of another.

Live session · join with code OTTO-PR2 · ottolearn.org/join

Same rules as always: vote before I explain, every poll is anonymous, and changing your mind after discussion is the goal.

Today · the follow-up Maya owes her reader

One reader's chain theory, five questions about "given".

Five questions, one reply. Every one starts with your vote.

Recall · last class · 45 seconds

Warm-up · 60 seconds · anonymous

Hold your vote — and notice the difference from last class: "I'm due" was superstition. "One night affects the next" is a real, testable claim. Today builds the tester.

Core concept 1 · C1

What "given" does: shrink the world

A bag holds 20 marbles: 8 red, 6 blue, 6 green. \(P(\text{red}) = 8/20 = 0.40\). Then someone peeks and says: "it's not green."

Throw away

The peek makes the 6 green marbles impossible. Cross them out — outcomes that contradict what you now know leave the sample space entirely.

Renormalize

Only 14 marbles remain, and they now share the whole probability. The 8 red marbles were never touched — yet red's share rises: \(8/14 \approx 0.57\). The numerator held; the denominator shrank.

The notation

"The probability of red, given not green" is written with a bar. Everything to the right of the bar is what you know — and what you know becomes the new universe.

\(P(A \mid B)\)

The information didn't touch a single red marble — it shrank the world around them. That's conditioning: restrict, then renormalize.

See it · C1

Watch the universe shrink

Predict first: click "Condition on 'not green'" — the denominator drops from 20 to 14. Does \(P(\text{red})\) rise, fall, or hold at 0.40?

A bag of 20 marbles: 8 red (R), 6 blue (B), 6 green (G). Unconditionally P(red) = 8/20 = 0.40. Conditioning on "not green" removes the 6 green marbles, shrinking the universe from 20 to 14, so P(red | not green) = 8/14 ≈ 0.57. The probability rises because the denominator shrinks while the red count stays 8.
Universe size: 20 marbles
P(red) = 8 / 20 = 0.40

Commit first · last class called this "next class's star"

Core concept 2 · C2

The formula: overlap over the given

The formula

The share of \(B\)'s world that also contains \(A\): joint probability on top, the given event's probability underneath — never the grand total.

\(P(A \mid B) = \dfrac{P(A \cap B)}{P(B)}\)

From a table: two numbers

Numerator: the cell where the two events cross. Denominator: the row or column total of the given event. The word "given" literally points at which total to divide by.

The poll, settled

Given part-time: universe 120, overlap 45 → \(45/120 = 0.375\). The other options were the AND (\(0.15\)), the reverse conditional (\(0.56\)), and the no-information rate (\(0.27\)).

\(\tfrac{45}{120} = 0.375\)

Every time you hear "given", ask one question first: what is my new denominator? It's always the total of the event after the bar.

See it · C2

The denominator switch, live

Predict first: conditioning on the row collapses the table to that row. Condition on the column instead — what changes: the numerator, the denominator, or both?

A
(Passed exam)
A′
(Did not pass)
Row total
B
(Studies in group)
36 9 45
B′
(Studies alone)
24 11 35
Column total 60 20 80
P(A | B) = count(A ∩ B) = 36 denominator = 80 = 36/80 = 0.45 ← P(A∩B), not a conditional

Dividing by n = 80 gives P(A∩B) = 0.45, not a conditional probability. Pick a conditioning event to restrict the universe.

Same numerator, different denominator: P(A | B) = 36/45 = 0.80  ≠  P(B | A) = 36/60 = 0.60. Direction matters.

Each mode keeps the same A∩B cell but changes the denominator

Practice · conditionals from a table · fresh numbers on demand

Core concept 3 · C3

The General Multiplication Rule: chances that chain

Rearrange the formula

Multiply both sides of C2's formula by \(P(B)\) and the AND probability pops out: the chance of the first thing, times the chance of the second given the first.

\(P(A \cap B) = P(B) \cdot P(A \mid B)\)

Works for ANY two events

Linked or not, this rule holds — the conditional factor absorbs whatever dependence exists. (The bare product \(P(A) \cdot P(B)\) is a shortcut that has to be earned. How to earn it is concept 6.)

This is how probabilities chain through time: step 1, then step 2 given step 1. Exactly the shape of the reader's "one night causes the next."

We do · you finish it

Two draws, no putting back

A bag holds 5 red and 3 blue marbles. Two are drawn without replacement. Find \(P(\text{first red AND second blue})\).

  1. First draw: \(P(\text{red}) = 5/8\) — eight marbles, five of them red.
  2. Second draw, given the first was red: the bag shrank to 7 marbles, still 3 blue → \(P(\text{blue} \mid \text{first red}) = 3/7\).
  3. Chain them: \(P(\text{first red AND second blue}) = ?\)

    \(\dfrac{5}{8} \times \dfrac{3}{7} = \dfrac{15}{56} \approx 0.27\). The second factor is conditional because the first draw changed the bag — and the rule absorbed that automatically.

Practice · the Multiplication Rule · fresh numbers on demand

Core concept 4 · C4

Tree diagrams: the Multiplication Rule as a picture

One stage at a time

A tree lays a multi-step experiment out left to right. Stage-1 branches carry unconditional probabilities; every later branch carries a conditional one — given the path taken so far.

Three rules

Branches leaving any node sum to 1. Multiply along a path → that path's AND probability. Add across paths → the total probability of an event that several paths reach.

Watch the decisions, not just the arithmetic — where each number goes, and why every stage-2 label is a conditional:

I do · watch the whole decision

Two assembly lines, out loud

Step 1 · Map the stages

A factory: Line 1 makes 60% of parts, Line 2 makes 40%. Line 1's defect rate is 2%; Line 2's is 5%. Stage 1 = which line (\(0.60\), \(0.40\)). The defect rates are given a line — so they're stage-2 conditionals, not standalone facts.

Step 2 · Check every node

Before multiplying anything: \(0.60 + 0.40 = 1\) ✓, \(0.02 + 0.98 = 1\) ✓, \(0.05 + 0.95 = 1\) ✓. A tree whose branches don't sum to 1 at a node is wrong before any arithmetic starts.

Step 3 · Multiply along each path

Line 1 AND defective: \(0.60 \times 0.02 = 0.012\). Line 2 AND defective: \(0.40 \times 0.05 = 0.020\). Each path-end is the Multiplication Rule in picture form.

Step 4 · Add across the paths

"Defective" can arrive by two paths, so \(P(\text{defective}) = 0.012 + 0.020 = 0.032\). Sanity check: all four path-ends, \(0.012 + 0.588 + 0.020 + 0.380 = 1\) ✓.

The habit: stages first, branches second; multiply along, add across. Now watch the same build happen live — then you'll run one backwards.

See it · C4

Build the tree, step by step

Load the example, then predict each path product before it appears. Tick the two defective leaves — does their sum land on \(0.032\)?

Enter branch probabilities (0–1). Each pair from one node must sum to 1. Path probabilities = product of the two branches along that path.

Two-stage probability tree. Fill in the branch probabilities to compute each path product and the event total. Outcome A Outcome B
Σ
Σ
Σ
?
?
?
?
Fill all inputs to verify the total sum.
Rule 3: tick the leaves that make up an event to add their path probabilities.

We do · run the tree backwards

A defective part lands on the desk

Same factory. A part just failed inspection — it is defective. The floor manager blames Line 1: "they make most of our parts."

  1. From the tree: \(P(\text{Line 1 AND defective}) = 0.012\), \(P(\text{Line 2 AND defective}) = 0.020\), so \(P(\text{defective}) = 0.032\).
  2. The question is a given: among defectives only. New universe: \(0.032\).
  3. \(P(\text{Line 1} \mid \text{defective}) = ?\) — is the manager right to blame Line 1?

    \(0.012 / 0.032 = 0.375\). Line 1 makes 60% of the parts but only 37.5% of the defects. The tree's path probabilities feed straight into C2's formula — and they acquit Line 1.

Practice · tree diagrams · fresh numbers on demand

Core concept 5 · C5

Independence: when the "given" changes nothing

The definition

Two events are independent when conditioning leaves the probability exactly where it was. The information was real — it just wasn't news about \(A\).

\(P(A \mid B) = P(A)\)

You've already met it

Last class's coin: five tails, and flip #6 stayed at \(1/2\). "The streak told us nothing" is \(P(H \mid 5\text{ tails}) = P(H)\). Independence is what "no memory" looks like in symbols.

It's symmetric

If \(B\) is no news about \(A\), then \(A\) is no news about \(B\) — checking either direction settles both at once.

The warm-up, settled: the reader claims his nights are not independent — that \(P(\text{short tonight} \mid \text{short last night})\) beats \(P(\text{short tonight})\). A legitimate claim. It needs data.

See it · C5

What independence looks like

Predict first: the dashed line marks \(A\)'s share within each column. If conditioning on \(B\) is to change nothing, where must that line sit? Drag the overlap until you've built independence by hand.

A mosaic plot of a sample space of 100 outcomes. B is the left column and B-prime the right; the top band of each column is event A.

A∩B can't exceed the smaller of |A|, |B|.

P(A) = 0.30 P(B) = 0.25 P(A∩B) = 0.10
P(A | B) = P(A∩B) / P(B) = 0.10 / 0.25 = 0.40

Core concept 6 · C6

The independence test: predicted overlap vs real overlap

The test

Multiply the two solo probabilities — that's the overlap independence would predict. If the real \(P(A \cap B)\) equals the product, independent; any gap means dependent.

\(P(A \cap B) \stackrel{?}{=} P(A) \cdot P(B)\)

Equivalent check

Or compare \(P(A \mid B)\) with \(P(A)\) — same verdict, every time. Use whichever pair of numbers the problem hands you.

Exact means exact

Independence requires equality, not "roughly." A small gap is still a gap: the events are dependent in this data. ("How big a gap before it matters?" is a later course's beautiful question.)

Time to answer the reader with Maya's own data. She can't follow his nights — but she can test whether short sleep travels with something else in her survey.

See it · C6

Expected vs actual, side by side

Predict first: the grey bar is \(P(A) \cdot P(B)\) — the overlap independence predicts. Drag the real overlap onto it: independence. Now push it above: what does "more overlap than predicted" say about the two events?

Two paired bar charts comparing the multiplication test (actual P(A∩B) vs expected P(A)·P(B)) and the conditional test (P(A|B) vs P(A)).
Expected under independence: P(A)·P(B) = 0.180
P(A∩B) is bounded by the marginals: it can't exceed min(P(A), P(B)) or fall below P(A)+P(B)−1, so moving P(A) or P(B) may nudge this slider.
P(A∩B) = 0.300 > P(A)·P(B) = 0.180 → DEPENDENT (positively associated)

Which tool decides? · mixes DS-1 + PR-1 + today

Practice · independent or not? · fresh numbers on demand

Core concept 7 · C7

Mutually exclusive vs independent — settled for good

ME: about overlap

Mutually exclusive is a statement about the sample space: the two events share no outcomes, so the overlap is exactly 0.

\(P(A \cap B) = 0\)

Independent: about information

Independence is a statement about news: knowing \(B\) occurred leaves \(A\)'s probability untouched.

\(P(A \mid B) = P(A)\)

The two-line proof

Let both events have positive probability, and let them be ME. Conditioning on \(B\): the numerator is 0, so the conditional is 0 — which is not \(P(A)\). ME events aren't merely "not independent" — they are maximally dependent.

\(P(A \mid B) = \dfrac{0}{P(B)} = 0 \neq P(A)\)

Last class this was a preview; the formula makes it a theorem. "Can't both happen" is the strongest possible news one event can deliver about another.

See it · C7

One click, two opposite worlds

Both panels obey the same click. Predict first: when you condition on \(B\), what happens to \(A\)'s share in the mutually-exclusive panel — and in the independent one?

Two Venn diagrams side by side. Left diagram: mutually exclusive events A and B — circles do not overlap. Right diagram: independent events A and B — circles overlap proportionally to P(A)·P(B).
Expected P(A∩B) if independent = P(A)·P(B) = 0.140
Mutually Exclusive → always dependent (knowing B ⇒ A is impossible; P(A|B) = 0 ≠ P(A))
Independent → never mutually exclusive (when P(A),P(B) > 0) (knowing B tells you nothing about A; P(A|B) = P(A))

Find the flaw · one line is wrong

Commit first · today's summit

Core concept 8 · C8

Direction matters: \(P(A \mid B) \neq P(B \mid A)\)

Two different questions

Sensitivity grades the test: among the sick, how many get flagged. The patient asks the reverse: among the flagged, how many are sick. Same overlap on top — two different universes underneath.

\(P(+ \mid \text{flu}) = 0.95\)

The base rate decides

When a condition is rare, the healthy crowd is enormous — even a small false-alarm rate mass-produces false positives until they outnumber every true case. That is how 95% and 16% coexist without contradiction.

\(P(\text{flu} \mid +) \approx 0.16\)

The reversal has a rap sheet

Courtrooms call it the Prosecutor's Fallacy: "the probability of this DNA match, given innocence, is 1 in 10,000" gets heard as "the probability of innocence is 1 in 10,000." Convictions have turned on that swap.

One habit prevents all of it: before trusting any "given" statement, say out loud which event is the universe — then check whether the question quietly reversed it.

See it · C8

400 students, one slider

Predict first: at 1% prevalence, which colour dominates the positives — true cases or false alarms? Drag prevalence down and watch \(P(\text{flu} \mid +)\) move while the test's accuracy never changes.

A 20 by 20 grid of dots, each representing a person, coded by test outcome and disease status. True positives are orange with a dark ring; false positives are blue; false negatives are orange with a colored ring; true negatives are faded. Conditioning on a positive test outlines the positive-test dots as one region with its count drawn on the grid.
True Positive — disease & test+ (ringed)
False Negative — disease & test−
False Positive — no disease & test+
True Negative — no disease & test−
P(disease) = 1.0%
P(+ | disease) = 90%
P(+ | no disease) = 5.0%
P(+) — Law of Total Prob = 5.85%
Of 400 people: 4 TP + 20 FP = 24 positive tests
P(disease | positive) = 15.4%
P(positive | disease) = 90% but P(disease | positive) = 15.4% — a difference of 75 pp

Production task · write the reply

Exit ticket · 60 seconds · anonymous

The reply Maya files

What Maya can now write

"Given" shrinks the world: every conditional probability lives inside its given event — the denominator is that event's total, never everyone's.

Independence is a test, not a vibe: multiply the solo rates, compare with the real overlap. Her own data: part-time work and short sleep are linked — 0.108 predicted, 0.15 observed.

Direction matters: a test that catches 95% of cases can leave a positive result meaning only 16% — reversing a conditional is the most dangerous move in applied probability.

The reader's chain theory needs night-by-night data — and reasoning about how a week of nights can unfold means counting arrangements without listing them. Next class: counting techniques.

Vote counts on today's slides are simulated for rehearsal; live sessions show the room's real votes.