Try
A fictional workload has two operating modes. Mode A occurs with probability 1/3 and has mean load 3; mode B occurs with probability 2/3 and has mean load 9. Predict the overall mean. The two conditional means should not be averaged equally because the modes occur with different probabilities.
Predict
Before the mode is observed, the conditional mean is itself random: it will be 3 or 9 depending on the mode. After observing a specific mode, it becomes the corresponding number. Predict why E(X|Y) and E(X|Y=y) refer to different stages of that information description.
Experiment
Let Y encode the mode. The tower property gives E(X)=E[E(X|Y)]=(1/3)·3+(2/3)·9=7.
| Mode | Probability | Conditional mean | Contribution to total mean |
|---|
| A | 1/3 | 3 | 1 |
| B | 2/3 | 9 | 6 |
Now consider density 1/2 on 0<x<y<2. The conditional mean is E(X|Y=y)=y/2 and f_Y(y)=y/2. Averaging the conditional means gives ∫₀²(y/2)(y/2)dy=2/3. Compare with integrating x against its marginal density (2−x)/2. Both methods produce the same mean.
Understand
For an integrable X, conditional expectation E(X|Y) represents its average given the information in Y. In the discrete case, calculate a weighted average under each conditional mass function. In the density case, integrate x against f_(X|Y)(x|y), yielding a function m(y). Then m(Y) is the conditional-expectation random variable.
The tower property E[E(X|Y)]=E(X) follows by reintegrating the conditional law against the marginal law of Y. Discrete sums or density integrals show the mechanism directly. More generally, conditioning successively on nested information obeys an iterated-expectation identity. The information sets must be correctly nested; arbitrary conditioning operations are not interchangeable.
Conditional expectation is defined almost surely. Different versions can disagree on marginal-null values without changing any expected quantities. A conditional formula at an unsupported input is not uniquely determined just because a calculator can substitute that input. Keep the conditioning support and integrability assumptions visible.
If X is independent of Y, its conditional mean equals E(X) almost surely. The converse is weaker: a constant conditional mean does not necessarily imply independence because conditional spread or other distributional features can still vary. Mean independence is one property of a joint law, not a complete characterization.
A measurable factor known from Y can be pulled outside the conditional average. For bounded g(Y) and integrable X, E[g(Y)X|Y]=g(Y)E(X|Y). Boundedness is a convenient condition ensuring integrability; more general versions require suitable product integrability. This rule uses available information, not independence.
Conditional expectation is not a guarantee of an individual outcome. Within a mode, actual loads can vary around the conditional mean. It also is not automatically a causal prediction under an intervention. The observed conditional law depends on the data-generating mechanism and any selection or confounding.
Stopping a fair process: prove the condition, not just the slogan
A filtration (Fₙ) records increasing information. An integrable, Fₙ-measurable sequence Mₙ is a martingale when E(Mₙ₊₁|Fₙ)=Mₙ. A nonnegative integer-valued T is a stopping time when the event T≤n is known from Fₙ. “Stop just before tomorrow’s loss” generally fails this definition. An unbiased next increment conditional on all current information is stronger than merely having unconditional mean zero.
If T≤N for a fixed integer N, then pathwise
MT=M0+k=1∑N(Mk−Mk−1)1{T≥k}. The indicator is Fₖ₋₁-measurable because T≥k means the decision not to stop by k−1 is already known. Conditional expectation makes each summand’s expectation zero. Therefore E M_T=E M₀. The same calculation applied to T∧n proves the stopped process is a martingale, checking conditional increments separately on already-stopped and still-running paths. There are finitely many integrable terms; no unproved infinite-sum interchange is hidden here.
For an unbounded almost-surely finite T, E M_(T∧n)=E M₀ still holds for every n, but convergence of random variables alone does not justify convergence of their means. Two sufficient extensions have short proofs:
- If |M_(T∧n)|≤Y for one integrable Y and every n, dominated convergence gives E M_T=E M₀.
- If |Mₖ−Mₖ₋₁|≤C almost surely for every k and E T<∞, then |M_(T∧n)−M₀|≤CT. This is an integrable dominating variable, so the same conclusion follows. More generally uniform integrability can replace domination; it needs its own verification.
A worked ruin calculation and its failure boundary
Let Sₙ be the simple fair walk starting at 0, and T the first hit of−b or a, where a,b are positive integers. Every block of a+b steps has probability at least 2^(−a−b) of exiting if it has not already done so, so T is finite almost surely and has finite expectation. The stopped values lie in[−b,a]. If p=P(S_T=a), bounded convergence of stopped walks gives 0=ap−b(1−p), hence p=b/(a+b).
For a=2,b=3 the probability of the upper exit is 3/5, not 1/2. The unequal boundary distances matter even though the individual steps are fair. The process Sₙ²−n is also a martingale, because E[(Sₙ+ξ)²−(n+1)|Fₙ]=Sₙ²−n for independent symmetric ξ. Stopping at T∧n gives E(T∧n)=E S_(T∧n)². Monotone convergence on the left and bounded convergence on the right yield E T=E S_T²=ab=6. This argument does not need to assume the second martingale has bounded increments globally.
Now let T be the first hit of+1 with no lower barrier. The recurrence argument shows T<∞ almost surely, but E T=∞. Here ST=1 while E S(T∧n)=0 for every n. The stopped values are not uniformly integrable: the rare long negative excursions retain the missing expectation. This is a counterexample to optional stopping without its limiting hypotheses, not a profitable contradiction of the bounded theorem.
Changed-case proof and repair
A fair walk starts at 2 and stops at 0 or 7. Before reading on, calculate its upper-exit probability and mean stopping time, then audit a rule that stops at the last visit to 2 before time 10. Translation gives a=5,b=2, so upper-exit probability 2/7 and mean time 10. The last-visit rule is not generally a stopping time: at time n one must know whether another visit to 2 will occur before 10. The bounded value 10 does not rescue the missing adapted-decision hypothesis. A complete response identifies the known information, derives both equations and distinguishes bounded time from a stopping time.
Primary statement reference: MIT18.440 Lecture 35, Spring 2014, checked 30 October 2026. The proofs above are finite-sum and dominated-convergence arguments, not a claim to cover continuous-time stochastic calculus.
Apply
Calculate the practice group-weighted mean, then deliberately use equal weights and explain the error. For the triangular density, derive the conditional mean and marginal weight separately before integrating. In a written report, specify what Y reveals and what variability remains after that information is known.
Continue
Next decompose the remaining uncertainty into within-group and between-group components. The same conditional mean also provides the best squared-error predictor from Y.