STATISTICS GRADUATE LEVEL • PROBABILITY FOUNDATIONS

Conditional Probability & Expectation — Conditional probability and conditional expectation (intro)

How incorporating partial information refines probabilistic predictions and reshapes entire distributions.

Historical Context & Motivation

The idea that new information should systematically update our beliefs about uncertain events is arguably the most powerful conceptual tool in probability theory. Long before any formal axiomatization, mathematicians and philosophers grappled with a deceptively simple question: if we learn that some event has occurred, how should our assessment of other events change? The resolution of this question gave rise to conditional probability and, ultimately, to conditional expectation — constructs that form the backbone of modern statistical inference, stochastic processes, and Bayesian analysis.

The earliest seeds of conditional reasoning appeared in games of chance during the 17th century, when correspondents like Pascal and Fermat debated how to divide stakes in an interrupted game given what had already transpired. Later, Thomas Bayes posed his famous problem of inverse probability — inferring the likelihood of causes given observed effects — which was published posthumously in 1763. This line of thinking crystallized into a formal definition only after Kolmogorov laid the measure-theoretic groundwork in the 1930s, providing the rigorous foundation upon which conditional expectation as a random variable (rather than a mere number) could be constructed.

1654
Pascal–Fermat Correspondence
Blaise Pascal and Pierre de Fermat exchange letters on the problem of points, reasoning about outcomes conditional on partial game results — the first systematic conditional probabilistic arguments.
1763
Bayes' Posthumous Essay
Thomas Bayes' An Essay towards Solving a Problem in the Doctrine of Chances introduces inverse probability, the conceptual precursor to Bayes' theorem and conditional inference.
1812
Laplace's Analytic Framework
Pierre-Simon Laplace systematizes conditional probability in Théorie analytique des probabilités, formulating what we now call Bayes' rule and applying it broadly to scientific problems.
1933
Kolmogorov's Axioms
Andrey Kolmogorov publishes Grundbegriffe der Wahrscheinlichkeitsrechnung, axiomatizing probability via measure theory and defining conditional probability rigorously, including the concept of conditional expectation with respect to a σ-algebra.
1940s–50s
Doob's Martingale Theory
Joseph Doob develops the theory of martingales and iterated conditional expectations, cementing conditional expectation as a central tool in modern stochastic analysis and mathematical finance.

The central question this lesson addresses is: given a probability space (Ω, ℱ, P) and information that some event B has occurred (or more generally, that the value of some random variable has been observed), how do we rigorously update both probabilities of events and expected values of random variables? Answering this question requires understanding conditional probability as a ratio, extending it to conditional distributions, and ultimately constructing conditional expectation as a random variable measurable with respect to the conditioning information.

Core Principles & Definitions

Before diving into formulas and measure-theoretic subtleties, it is essential to internalize the foundational ideas that govern conditional probability and conditional expectation. These concepts are not merely computational recipes; they embody a philosophy of belief revision under partial information, and every advanced topic — from Bayesian inference to filtering theory — rests on the principles articulated here.

1

Conditional Probability as Restriction

P(A | B) = P(A ∩ B) / P(B) redefines the sample space by restricting attention to outcomes in B. It renormalizes the probability measure so that B becomes the new universe with total probability 1.
2

The Law of Total Probability

If {B₁, B₂, …} is a partition of Ω, then P(A) = Σᵢ P(A | Bᵢ) P(Bᵢ). This decomposes marginal probabilities into weighted contributions from each conditioning scenario.
3

Bayes' Rule as Inversion

Bayes' theorem reverses the direction of conditioning: P(B | A) = P(A | B)P(B) / P(A). It lets us compute posterior beliefs about causes from observed effects, the engine of Bayesian inference.
4

Conditional Expectation as a Random Variable

E[X | Y] is not a single number but a function of Y — a random variable itself. It is the best prediction of X given knowledge of Y, in the mean-squared-error sense.
5

Tower Property (Iterated Expectation)

E[E[X | Y]] = E[X]. Averaging the conditional expectation over the conditioning variable recovers the unconditional expectation — a consistency check that links partial and full information.
KEY TAKEAWAY
Think of conditional probability as adjusting the lens on a camera. When you condition on B, you are zooming into the region of the sample space where B is true, discarding everything outside, and rescaling so the remaining probabilities sum to 1. Conditional expectation extends this: rather than a single zoom, imagine a camera that automatically refocuses depending on the observed value of Y, producing a different expected value for each setting. The tower property guarantees that if you step back and average across all possible focus settings, you recover the overall scene — the unconditional expectation.

Visual Explanation — Venn Diagram & Restriction of Sample Space

The most intuitive way to grasp conditional probability is through a Venn diagram that shows how conditioning on event B transforms the probability landscape. In the diagram below, the full sample space Ω is represented by the outer rectangle. Events A and B are overlapping regions. The conditional probability P(A | B) is simply the proportion of B's area that also belongs to A — the intersection A ∩ B relative to B, not relative to the whole of Ω.

The violet circle represents event A and the cyan circle represents event B. Their overlap (shaded pink) is A ∩ B. Conditioning on B means treating B as the entire sample space: P(A | B) equals the pink area divided by the full cyan area.

Notice the conceptual shift: unconditional probability P(A) measures A against all of Ω, while conditional probability P(A | B) measures A only within B. Geometrically, conditioning shrinks the reference set. This simple idea has profound implications — it is why, for instance, the probability of a positive medical test being a true positive depends critically on the prevalence of the disease (the conditioning event). When B has small probability, even a highly accurate test can yield a conditional probability of disease that is surprisingly low, a fact that Bayes' rule makes precise.

Mathematical Framework

We now formalize the definitions, beginning with the elementary ratio definition of conditional probability, proceeding through Bayes' theorem, and then extending to conditional expectation — first in the discrete case and then via the abstract (measure-theoretic) definition that handles continuous and general random variables.

CONDITIONAL PROBABILITY
P(A | B) = P(A ∩ B) / P(B), provided P(B) > 0
A, B are events in a probability space (Ω, ℱ, P). The condition P(B) > 0 is essential; the ratio is undefined when the conditioning event has zero probability, motivating the measure-theoretic extension.
BAYES' THEOREM
P(Bⱼ | A) = P(A | Bⱼ) P(Bⱼ) / Σᵢ P(A | Bᵢ) P(Bᵢ)
{B₁, B₂, …, Bₙ} is a partition of Ω. P(Bⱼ) is the prior probability, P(A | Bⱼ) is the likelihood, and P(Bⱼ | A) is the posterior probability.
CONDITIONAL EXPECTATION (DISCRETE CASE)
E[X | Y = y] = Σₓ x · P(X = x | Y = y)
When X and Y are discrete random variables, E[X | Y = y] is a weighted average of the values of X, using the conditional PMF p_{X|Y}(x | y) as weights. As y varies, E[X | Y = y] defines a function g(y), and E[X | Y] = g(Y) is itself a random variable.
LAW OF TOTAL EXPECTATION (TOWER PROPERTY)
E[X] = E[ E[X | Y] ]
Averaging the conditional expectation E[X | Y] over all possible values of Y recovers the unconditional expectation. In the discrete case: E[X] = Σ_y E[X | Y = y] P(Y = y). This property generalizes to σ-algebras: E[ E[X | 𝒢] ] = E[X].

In the continuous setting, conditional expectation given Y = y is defined through the conditional density: E[X | Y = y] = ∫ x · f_{X|Y}(x | y) dx, where f_{X|Y}(x | y) = f_{X,Y}(x, y) / f_Y(y). The fully abstract version — conditioning on a sub-σ-algebra 𝒢 — defines E[X | 𝒢] as the unique (a.s.) 𝒢-measurable random variable Z satisfying ∫_G Z dP = ∫_G X dP for every G ∈ 𝒢. This definition, guaranteed by the Radon–Nikodým theorem, is the cornerstone of advanced probability and will be explored in detail in subsequent lessons.

Types of Conditioning & Key Properties

Conditional probability and expectation take different forms depending on what kind of object we condition on and the nature of the random variables involved. Understanding this taxonomy is crucial because each setting demands its own technical machinery and carries its own set of pitfalls — most notably the Borel–Kolmogorov paradox, which arises when conditioning on continuous random variables is done carelessly.

This taxonomy shows three levels of conditioning — on an event, on a random variable, and on a σ-algebra — with the resulting forms of conditional probability and expectation. The bottom row highlights three fundamental algebraic properties of conditional expectation.
Fundamental properties of conditional expectation
PropertyStatementIntuition
LinearityE[aX + bZ | Y] = aE[X | Y] + bE[Z | Y]Conditional expectation behaves like ordinary expectation within each 'slice' of Y.
Tower / Iterated ExpectationE[E[X | Y]] = E[X]Averaging all conditional predictions reproduces the overall average.
Pull-out (Taking Out Known)E[h(Y) · X | Y] = h(Y) · E[X | Y]Functions of Y are 'constants' when Y is known, and can be factored out.
IndependenceIf X ⊥ Y: E[X | Y] = E[X]Knowing Y adds no information about X; the conditional expectation collapses to a constant.
Watch Out: The Borel–Kolmogorov Paradox
When conditioning on a continuous random variable Y taking a specific value y (an event of probability zero), the conditional distribution is not uniquely determined by the probability measure alone — it depends on how you parameterize the conditioning variable. The regular conditional distribution resolves this by specifying a version of the conditional probability that is a proper probability measure for each y. This subtlety is why the measure-theoretic definition uses σ-algebras rather than point conditioning.

Worked Example — Conditional Expectation of a Joint Distribution

Consider two jointly distributed discrete random variables X and Y with the following joint probability mass function. We will compute P(X = 1 | Y = 0), the conditional PMF of X given Y = 1, E[X | Y = 1], and verify the tower property E[E[X | Y]] = E[X].

Joint PMF p(x, y) for X ∈ {0, 1, 2} and Y ∈ {0, 1, 2}
X \ YY = 0Y = 1Y = 2
X = 00.100.150.05
X = 10.200.100.10
X = 20.050.150.10
Computing Conditional Probability and Conditional Expectation
1
Step 1 — Compute Marginal P(Y = y)Sum across X for each value of Y. P(Y = 0) = 0.10 + 0.20 + 0.05 = 0.35. P(Y = 1) = 0.15 + 0.10 + 0.15 = 0.40. P(Y = 2) = 0.05 + 0.10 + 0.10 = 0.25.
P(Y = 0) = 0.35, P(Y = 1) = 0.40, P(Y = 2) = 0.25
2
Step 2 — Compute P(X = 1 | Y = 0)Apply the definition: P(X = 1 | Y = 0) = P(X = 1, Y = 0) / P(Y = 0) = 0.20 / 0.35 = 4/7 ≈ 0.5714.
P(X = 1 | Y = 0) = 4/7 ≈ 0.571
3
Step 3 — Compute the Conditional PMF of X Given Y = 1For each x: P(X = x | Y = 1) = P(X = x, Y = 1) / P(Y = 1). So P(X = 0 | Y = 1) = 0.15/0.40 = 3/8, P(X = 1 | Y = 1) = 0.10/0.40 = 1/4, P(X = 2 | Y = 1) = 0.15/0.40 = 3/8. Verify: 3/8 + 1/4 + 3/8 = 3/8 + 2/8 + 3/8 = 8/8 = 1 ✓.
p_{X|Y}(0|1) = 3/8, p_{X|Y}(1|1) = 1/4, p_{X|Y}(2|1) = 3/8
4
Step 4 — Compute E[X | Y = 1]E[X | Y = 1] = Σₓ x · P(X = x | Y = 1) = 0 × (3/8) + 1 × (1/4) + 2 × (3/8) = 0 + 1/4 + 3/4 = 1.0.
E[X | Y = 1] = 1.0
5
Step 5 — Compute E[X | Y = y] for All y and Verify the Tower PropertySimilarly compute: E[X | Y = 0] = 0(2/7) + 1(4/7) + 2(1/7) = 6/7 ≈ 0.857. E[X | Y = 2] = 0(1/5) + 1(2/5) + 2(2/5) = 6/5 = 1.2. Now E[E[X | Y]] = E[X | Y = 0] · P(Y = 0) + E[X | Y = 1] · P(Y = 1) + E[X | Y = 2] · P(Y = 2) = (6/7)(0.35) + (1.0)(0.40) + (1.2)(0.25) = 0.30 + 0.40 + 0.30 = 1.00. Direct computation: E[X] = 0(0.30) + 1(0.40) + 2(0.30) = 1.00 ✓. The tower property holds.
E[E[X | Y]] = E[X] = 1.00 ✓ Tower property verified

Unconditional vs. Conditional — Strengths & Limitations

Understanding when to use conditional versus unconditional quantities, and appreciating the trade-offs, is essential for applied probability and statistics. Conditional reasoning is more powerful but introduces additional complexity — both computational (you must know joint distributions or likelihoods) and conceptual (the conditioning variable itself may be random, leading to random expectations that require further averaging).

Comparison: unconditional vs. conditional probability and expectation
AspectUnconditionalConditional
Information usedNone — computed from the marginal distribution alonePartial observation (event B, or random variable Y)
Output typeA fixed number: P(A) or E[X]A number (given event) or a random variable (given Y)
Prediction qualityBest constant predictor (minimizes variance but ignores information)Optimal predictor given available information (minimizes MSE)
Computational costRequires only marginal distributionRequires joint distribution or conditional model
PitfallsSimpson's paradox: marginal association can reverse conditional onesBorel–Kolmogorov paradox; requires careful specification in continuous case
KEY TAKEAWAY
Consider engineering a recommendation system. The unconditional expectation E[Rating] tells you the average rating across all users and all items — useful but crude. The conditional expectation E[Rating | User = u, Item = i] leverages user and item information to predict the specific rating for user u on item i, dramatically improving accuracy. This mirrors how conditional expectation always reduces mean-squared prediction error compared to the unconditional mean, a property formalized by the law of total variance: Var(X) = E[Var(X | Y)] + Var(E[X | Y]).

Connection to Advanced Theory

The introductory definitions of conditional probability and conditional expectation presented here serve as stepping stones to far deeper constructions. In advanced probability theory, conditioning on a σ-algebra replaces the naive ratio definition and enables conditioning on events of probability zero. This leap is not merely pedantic — it is the foundation upon which martingale theory, Markov process theory, and stochastic filtering rest.

From introductory to advanced conditional constructs
Introductory ConceptAdvanced GeneralizationWhere It Matters
P(A | B) = P(A∩B)/P(B)Regular conditional probability P(A | 𝒢)(ω)Disintegration of measures; Bayesian nonparametrics
E[X | Y = y] via conditional PMF/PDFE[X | 𝒢] defined via Radon–NikodýmMartingale convergence, stochastic calculus
Tower property E[E[X|Y]] = E[X]Nested σ-algebras: 𝒢₁ ⊂ 𝒢₂ ⇒ E[E[X|𝒢₂]|𝒢₁] = E[X|𝒢₁]Filtration-based arguments; optional stopping theorem
Law of total varianceANOVA decomposition; Eve's law in hierarchical modelsBayesian hierarchical modeling, meta-analysis

A particularly important generalization is the concept of a martingale: a stochastic process (Mₙ) adapted to a filtration (ℱₙ) such that E[Mₙ₊₁ | ℱₙ] = Mₙ. This is an iterated conditional expectation condition that captures the idea of a 'fair game' — the best prediction of the future, given the present, is the present value. The optional stopping theorem, convergence theorems for martingales, and the pricing of financial derivatives all flow from this single conditional expectation identity.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain in your own words why E[X | Y] is a random variable rather than a fixed number, and describe in what sense it is 'known' once Y is observed.
PROBLEM 2BASIC CALCULATION
A bag contains 3 red and 7 blue balls. Two balls are drawn without replacement. Let A = {second ball is red} and B = {first ball is red}. Compute P(A | B) and P(A | Bᶜ).
PROBLEM 3INTERMEDIATE
Let X ~ Geometric(p) with P(X = k) = (1−p)^(k−1)p for k = 1, 2, .... Compute E[X | X > n] for a fixed positive integer n, and interpret the result in light of the memoryless property.
PROBLEM 4APPLIED
An insurance company classifies drivers as low-risk (60% of drivers, claim rate λ₁ = 0.1 per year) or high-risk (40%, claim rate λ₂ = 0.5 per year). Claims follow a Poisson distribution. A randomly selected driver files 2 claims in one year. What is the posterior probability that this driver is high-risk?
PROBLEM 5CRITICAL THINKING
Let X be an integrable random variable and 𝒢₁ ⊂ 𝒢₂ ⊂ ℱ be sub-σ-algebras. Prove the tower property in this generality: E[E[X | 𝒢₂] | 𝒢₁] = E[X | 𝒢₁] a.s. using the definition of conditional expectation.

Lesson Summary

Conditional probability P(A | B) = P(A ∩ B) / P(B) formalizes how learning that event B has occurred restricts the sample space and rescales probabilities accordingly. This simple ratio is the gateway to Bayes' theorem, which inverts conditional probabilities to compute posteriors from priors and likelihoods, and to the law of total probability, which decomposes marginal probabilities via partitions. These tools are indispensable in Bayesian inference, diagnostic testing, and decision-making under uncertainty.

Conditional expectation E[X | Y] generalizes the notion: rather than a single number, it is a random variable — the best predictor of X given information about Y in the mean-squared-error sense. Its key algebraic properties — linearity, the tower property E[E[X | Y]] = E[X], and the pull-out rule — form the backbone of martingale theory, stochastic filtering, and hierarchical modeling. The measure-theoretic extension, conditioning on a σ-algebra via the Radon–Nikodým theorem, provides the rigorous foundation for all of modern stochastic analysis.

Varsity Tutors • Statistics Graduate Level • Conditional Probability & Expectation — Conditional probability and conditional expectation (intro)