Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Probability & Measure
Probability Space
ฯƒ-Algebras
InformationFiltration
Lebesgue Measure
Random Variables
SpinnerDistribution function
Lebesgue Integral
Riemann vs LebesgueExpectation by sorting
Convergence
Escaping massModes of convergence
Conditional Expectation
Best guessChange of measure
Connected Guides
  • Conditional probability and conditional expectation
  • Measure theory in option pricing
  • Conditional expectation and martingales
  • Change of measure and Girsanov's theorem

ยฉ 2026 Quant Sandbox ยท A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage โ€” your chosen theme and language, the sidebar layout, and your progress and answers in the Guides โ€” so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Conditional expectation

Controls

What the observer knows ยท ๐’ข
Display
Reference
E[X] with no information
161/36 = 4.472
The best guess from what you know

X = the larger of the two dice

E[X | first die]: row averages

second die โ†’first die โ†’123456123456
โ†’โ†’โ†’โ†’โ†’โ†’
3.503.674.004.505.176.00

Error left after the guess, E[(X โˆ’ guess)ยฒ]

  • knows nothing ยท guess 4.47 everywhere1.97
  • knows the first die1.20
  • knows both dice ยท guess = X0

tower check: (3.50 + 3.67 + 4.00 + 4.50 + 5.17 + 6.00) / 6 = 4.472 = E[X]

guess if first die = 3
4.00
average of the guesses
4.472 = E[X]
squared error left
1.20 of 1.97
distinct guesses
6, one per block

About this tool

The conditional expectation of X given a ฯƒ-algebra is your best guess of X when all you know is which block of information the outcome fell in: X averaged over that block. It is itself random, because it changes with the block, but it uses only what the observer sees. The more information you have, the smaller the blocks and the closer the guess gets to X. A second page changes the probability measure by reweighting, the idea behind Girsanov's theorem and risk-neutral pricing.

Frequently asked questions

What is conditional expectation?

Given a ฯƒ-algebra ๐’ข, E[X | ๐’ข] is the ๐’ข-measurable random variable that agrees with X on average over every event in ๐’ข. When ๐’ข is generated by blocks this is just the block average of X, assigned to every outcome in the block. It is the best prediction of X in the least-squares sense using only the information in ๐’ข. Conditioning on nothing gives the ordinary expectation, and conditioning on everything gives X itself.

What is the tower property?

Averaging the guesses gives back the plain expectation: E[E[X | ๐’ข]] = E[X]. More generally, if you condition first on a fine ฯƒ-algebra and then on a coarser one, the result is the same as conditioning on the coarser one directly. Information that is later forgotten leaves no trace. This is why a martingale, a process whose best guess of the future is today's value, stays consistent over time.

What should I try on the pages?

Choose what you know about two dice and watch the guess of a value such as the larger die: it is constant on every block. Compare the squared error of the guess with the variance, which is the error of guessing without any information, and see the error shrink as the blocks get smaller. On the second page reweight samples by dQ/dP and see a standard normal turn into a shifted one without moving a point.

Is a change of measure a change of the outcomes?

No. The outcomes and their values stay exactly the same; only the weights change. A new measure Q is built by giving each outcome a weight dQ/dP, and expectations under Q are P-expectations of the weighted variable. Girsanov's theorem gives that weight for whole Brownian paths. In pricing, the real-world P and the risk-neutral Q share every path and differ only in how much each path counts.

Learn the theory

  • Conditional probability and conditional expectation โ€” Conditioning on an event, Bayes' rule, block averages over a partition, conditional expectation given a ฯƒ-algebra, best prediction and the tower property.
  • Measure theory in option pricing โ€” How the measure theory and probability of this track meet in option pricing: equivalent measures and densities, information, conditional expectation, limits.
  • Conditional expectation and martingales โ€” Conditional expectation given the past, fair games, why no betting strategy beats a martingale, and discounted prices under Q.
  • Change of measure and Girsanov's theorem โ€” Reweighting probabilities with a density, equivalent measures, Girsanov's theorem and the market price of risk.