Conditional Probability
The conditional probability of given that has occurred is
Conditioning on shrinks the sample space to just the outcomes in : we ask what fraction of 's probability also lies in . Rearranging gives the form you will use constantly,
In a finite equally-likely setting this is simply : recount inside the restricted world .
A fair die is rolled. Given that the result is even, what is the probability it is greater than ?
Solution. Let and . Then , so
Knowing “even” throws away the odd outcomes; we only compare within .
Two cards are drawn from a standard -card deck without replacement. What is the probability the second is a heart given the first was a heart?
Solution. After removing one heart, hearts remain among cards, so
Conditioning literally updates the deck.
Pitfall. and are different numbers. “The probability of a rash given measles” is near ; “the probability of measles given a rash” is tiny. Swapping the two is the single most common conditional-probability error.
The Multiplication Rule & Probability Trees
Solving for the intersection gives the multiplication rule:
For a sequence of stages it chains (the chain rule):
A probability tree draws this: each branch carries a conditional probability, and the probability of a full path is the product of the branch probabilities along it. Probabilities on branches leaving a node sum to ; probabilities of the leaves sum to .
Multiply along a path for a leaf; add leaves for an event.
Two cards are drawn without replacement. Probability both are aces?
Solution. Multiply along the path:
A box has red and blue balls. Draw two without replacement. Probability of exactly one red?
Solution. Two paths give “one red”: RB and BR.
Multiply along each path, then add the paths that satisfy the event.
Tip. Trees turn “and” into multiplication and “or” into addition automatically. Whenever a problem unfolds in stages (draw, then draw; test, then confirm), sketch the tree before writing any algebra.
Independence
Events and are independent exactly when
equivalently (when the conditionals are defined) and . Learning that happened does not change the probability of .
For several events, mutual independence requires the product rule to hold for every subcollection, not just pairs. Pairwise independence does not imply mutual independence.
Draw a card, replace it, reshuffle, draw again. Are “first is a heart” and “second is a heart” independent?
Solution. With replacement the deck resets: , so yes. Without replacement it was , so no. Replacement is the usual switch between independent and dependent.
Roll two fair dice. Let “first die is ” and “sum is ”. Independent?
Solution. , . The pairs with first die and sum are , so . Check: . Equal, so independent.
Pitfall. Independent is not the same as mutually exclusive. Disjoint events with positive probability are strongly dependent: if then . Always test independence with the product rule, never by intuition.
The Law of Total Probability
Let partition the sample space (disjoint, together all outcomes, each ). For any event ,
Each term is one path of a tree: choose the scenario , then let happen inside it. This is the workhorse for computing an overall probability when the world splits into cases.
Urn 1 has red, white; Urn 2 has red, white. Flip a fair coin to pick an urn, then draw a ball. Probability the ball is red?
Solution. Partition by the urn:
Machines A, B, C make of output with defect rates . Probability a random item is defective?
Solution.
A weighted average of the defect rates, weighted by production share.
Tip. The weights must sum to and the cases must not overlap. When you see “there are several types/sources, each with its own rate,” reach for total probability.
Bayes' Theorem
Combining with the law of total probability gives Bayes' Theorem:
It converts the prior (belief before the evidence) into the posterior (belief after seeing ). The numerator is one path; the denominator is all paths reaching .
Using the two-urn setup above, a red ball was drawn. Probability it came from Urn 1?
Solution.
The red ball is evidence that shifts belief toward the red-heavy urn.
For the three machines above, a defective item is found. Probability it was machine C's?
Solution.
Even though C makes only of output, its high defect rate makes it responsible for over a third of defects.
Tip. A clean recipe: (1) list the scenarios and their priors, (2) attach the likelihood to each, (3) multiply for each path, (4) divide the target path by the sum of all paths. Steps 1--3 are just a tree; Bayes is only the final division.
Classic Traps: Monty Hall, Two-Child, False Positives
Each trap hides a conditioning step. The intuition “symmetry means ” fails because the evidence is not symmetric across the hidden scenarios. Draw the tree, weight by priors, and let Bayes overrule the gut.
Three doors hide one car and two goats. You pick a door; the host --- who knows where the car is --- opens a different door revealing a goat, then offers a switch. Should you switch?
Solution. Your first pick is right with probability and wrong with probability . The host's guaranteed goat-reveal gives no new information about your original door, so:
- 2pt
- If you initially picked the car (), switching loses.
- If you initially picked a goat (), the host is forced to reveal the other goat, so the remaining door hides the car --- switching wins.
Therefore , double the from staying. The key is that the host's choice is constrained by knowledge; a host opening a random door would change the analysis.
A disease affects in people. A test is accurate both ways (sensitivity , specificity ). You test positive. What is the probability you actually have the disease?
Solution. Let be disease, a positive test. Priors , .
By Bayes,
Only about ! Because the disease is rare, the many false positives from the huge healthy population swamp the few true positives. The base rate dominates.
A family has two children.
- 2pt
- “At least one is a boy.” Probability both are boys? Sample space is equally likely; condition on at least one boy: , of which is one. Answer .
- “The older is a boy.” Probability both boys? Now condition on : answer .
Same family, different information, different answers --- see Going Deeper for why the phrasing matters.
Pitfall. In every trap, how the information was obtained changes the conditioning set. “I met one of the children and he's a boy” is not the same evidence as “at least one child is a boy,” even though both mention a boy. Model the process, not just the sentence.
Going Deeper: Bayesian Updating, Conditioning, and Ambiguity
Bayesian updating treats probability as a state of belief refined by evidence. The posterior after one observation becomes the prior for the next:
Independent pieces of evidence multiply their likelihood ratios. A rare hypothesis can still win if the evidence is strong enough, and a common one can survive weak evidence --- exactly the tension in the medical-test example.
The rare disease () test above comes back positive; a second independent test (same accuracy) is also positive. Now find .
Solution. Use the first posterior as the new prior:
Two positives push belief from to about . Evidence compounds.
Why does “at least one boy” give but “the older is a boy” give ?
Solution. Conditioning removes outcomes unevenly. “Older is a boy” eliminates and , leaving two equally likely worlds . “At least one boy” eliminates only , leaving three worlds , and is just one of them. The information “at least one” is weaker --- it does not pin down which child --- so it cuts the space less. Intuition fails because we imagine the evidence naming a specific child when it does not.
“A family has two children; I tell you at least one is a boy born on a Tuesday. Both boys?” The Tuesday detail, seemingly irrelevant, shifts the answer to , not .
Solution sketch. Each child is one of equally likely (gender, weekday) types. Counting the ordered pairs containing at least one “boy-Tuesday” gives ; those with two boys give ; hence . The lesson: the more specifically the evidence identifies a child, the closer the answer creeps to . Ambiguous wording has no single “right” answer until the sampling process is fixed.
Big picture --- conditioning is re-weighting your world. Every result in this unit is one identity, , read in different directions:
- 2pt
- Forward (trees, multiplication, total probability): split into cases, multiply along paths, add paths to get .
- Backward (Bayes): once is observed, divide the target path by all paths to get --- prior times likelihood, normalized.
- Independence is the special case where conditioning changes nothing: .
- The traps all come from misreading which outcomes the evidence keeps. Always model the process that produced the information, weight by the priors (mind the base rate), and trust the arithmetic over the gut.
The Odds Form of Bayes & Sequential Updating
Write Bayes' theorem for two competing hypotheses and its complement and divide the two versions. The awkward normalizing denominator cancels, leaving the odds form:
Updating is now pure multiplication: posterior odds LR prior odds. For a stream of conditionally independent pieces of evidence the likelihood ratios simply multiply,
This is iterated Bayesian updating: each posterior is the next prior, and in odds language the whole computation collapses to one product. Recover a probability at the end via .
A disease has prevalence . A test has sensitivity and false-positive rate , giving likelihood ratio . Three independent tests all read positive. Find .
Solution. Prior odds . Multiply by once per positive:
Convert back:
One positive left belief near (the base rate dominated); the odds form shows why each extra positive multiplies the odds by , so three positives overwhelm even a -in- prior.
Same test. A patient tests positive, then negative on an independent retest. What is now?
Solution. The negative test has its own likelihood ratio . Chain both:
The two tests exactly cancel, returning belief to the prior . Contradictory evidence multiplies to a net ratio of --- a fact almost invisible in the fraction form but obvious in odds.
Tip. Whenever a problem chains several independent clues toward one yes/no hypothesis, switch to odds: multiply the prior odds by each likelihood ratio, then convert once at the end. It sidesteps the denominator entirely and makes “how much does this clue matter?” literally a multiplier.
Markov Chains & Transition Matrices
A Markov chain moves among states so that the next state depends only on the current one, not the past history:
Collect these into the transition matrix ; each row sums to . If the current distribution over states is a row vector , then after one step it is , and after steps . The entry of is exactly --- multi-step probabilities are just matrix powers.
A stationary distribution satisfies with : the chain, once in , stays distributed as forever. An absorbing state has (once entered, never left).
Weather follows a chain on states (Sunny, Rainy) with
(a) If today is sunny, probability it is rainy the day after tomorrow? (b) What fraction of days are sunny in the long run?
Solution. (a) Compute the two-step matrix:
The (Sunny Rainy) entry is .
(b) Solve with , . The first component gives , i.e. , so . With we get . Sunny two-thirds of the time.
A token sits on states with absorbing:
Starting at , what is the probability of eventual absorption at ? (Here it is forced, so instead find the probability that the token visits before being absorbed.)
Solution. From the first move is to or with probability each. It visits before absorption iff the very first step lands on (from the only escape is to eventually, but the “before absorption” visit is already secured). Hence . To confirm absorption is certain, note is reachable from both and and is absorbing, so with probability the token is eventually trapped at : powers push all mass into column .
Tip. Rows of must each sum to --- always sanity-check this first. Multi-step questions ( days later, moves later) are ; “in the long run / eventually / steady state” questions are the stationary equation . Never confuse a single large power with the stationary vector unless the chain has actually settled.
Gambler's Ruin
A gambler holding bets per round, winning with probability and losing with probability , until reaching a target (win) or (ruin). Let be the probability of reaching before starting from . Conditioning on the first bet (this is first-step analysis) gives the recurrence
Solving this linear recurrence yields the classic formulas
The fair case is a straight line in ; the biased case is governed by the ratio .
You start with and play a fair game (), quitting at or . Probability you reach ?
Solution. With , , :
In a fair game the chance of hitting the target before ruin is just your current fortune as a fraction of the target --- no arithmetic beyond a ratio.
A gambler starts at , wants to reach , and wins each bet with probability (so , ratio ). Probability of success?
Solution. Use the biased formula with :
Only about . A small per-bet disadvantage compounds brutally over the distance to the target: fighting the house edge across many rounds is nearly hopeless. (Contrast the fair game, where the same .)
Big picture. Gambler's ruin is the template for every “random walk with two barriers” problem: set for the boundary event, condition on the first step to get , and impose the boundary values. The same recurrence machinery reappears in fair-coin streak problems, tennis deuce, and best-of- series.
First-Step Analysis & Conditional Expectation (Unit 9 Preview)
First-step analysis solves “how long / how likely” questions on a chain by conditioning on the very first transition and using the memoryless property: after one step the problem looks like the same problem from the new state. This turns a hard infinite process into a small linear system.
For expected times it uses the tower property of conditional expectation,
where reaching a new state contributes the step already taken plus the expected remaining time from . Letting typically yields a recurrence such as with at absorbing states. This conditional-expectation viewpoint is the gateway to Unit 9.
Let be the expected number of fair-coin flips to first see HH. Track states by current progress: (no useful streak), (one so far). Let , .
Solution. First-step analysis on each state:
From the first equation . Substitute into the second: , so , and . The expected number of flips is . (The general pattern for a streak of heads is .)
In the fair gambler's-ruin game (), let be the expected number of bets until hitting or from . Find a formula.
Solution. Condition on the first bet:
Rewrite as : the second difference is constant, so is quadratic. Trying gives , which checks, and . Hence
Starting at the midpoint the game lasts an expected bets --- surprisingly long. First-step analysis converts the recurrence directly into the answer.
Bridge to Unit 9. Everything here is one idea: condition on the first step, then reuse the structure of the problem. For probabilities it gives ; for expected times it gives . The tool is conditional expectation and its tower property, --- the central engine of Unit 9. Master first-step analysis now and expectation will feel like the same move applied to averages instead of probabilities.
Formulas, Proofs & Tips
What it means. Knowing happened shrinks the sample space to . Bayes reverses the conditioning.
Example. If and , then .
Why it works. Once is known, only outcomes inside remain possible, so probabilities are rescaled by dividing by . Bayes follows because can be written two ways: .
Tip. and are independent exactly when , i.e. .