Conditional Expectation Calculator

Conditional expectation is the average value of a random variable once you restrict attention to outcomes that satisfy a condition. This calculator handles a discrete variable defined by a list of values and their probabilities. Pick a threshold and it computes E[X given X is at or above that threshold], by keeping only the qualifying outcomes, renormalising their probabilities, and taking the weighted mean. It also reports the conditional probability of the event and the plain unconditional mean for comparison. This is the truncated mean used widely in risk, insurance, and tail analysis.

0.00
0.00
0.00
0.00

Conditional expectation formula

Qualifying outcomes: those with x >= t
P(X >= t) = sum of p over qualifying outcomes
E[X | X >= t] = (sum of x*p over qualifying) / P(X >= t)
Unconditional E[X] = sum of x*p over all outcomes

The conditioning event must have positive probability. The conditional mean is at least as large as the threshold and typically larger than the unconditional mean, since the lower outcomes are excluded.

Notes on inputs

  • Values and probabilities must be lists of equal length, paired in order.
  • Probabilities should be non-negative; the sum is shown so you can confirm it equals 1.
  • The threshold uses an at-or-above (greater than or equal to) condition.
  • If no outcome meets the threshold, the result is undefined and shown as n/a.
  • The unconditional mean is provided for direct comparison with the conditioned result.

Conditional expectation: frequently asked questions

What is conditional expectation?

Conditional expectation E[X | A] is the average value of a random variable X given that event A has occurred. It re-weights the outcomes so only those consistent with A count, then takes their probability-weighted mean using the conditional probabilities. It answers: knowing A happened, what value do we expect for X?

How is E[X | X greater than or equal to t] calculated?

Keep only the outcomes where the value meets the threshold t. Sum value times probability over those outcomes, then divide by the total probability of those outcomes: E[X | X >= t] = (sum of x*p over qualifying x) / (sum of p over qualifying x). The divisor is the conditional probability P(X >= t).

What format should I use for the inputs?

Enter outcome values and their probabilities as comma-separated lists of equal length. Probabilities should be non-negative and sum to 1 (or close to it). The calculator pairs the first value with the first probability, the second with the second, and so on.

What is the difference from a plain expected value?

A plain expected value E[X] averages over every outcome. A conditional expectation restricts attention to a subset (here, outcomes at or above a threshold) and renormalises the probabilities within that subset, so the result reflects only the conditioned scenario.

What if no outcome meets the threshold?

If the conditioning event has zero probability (no outcome qualifies), the conditional expectation is undefined because you would divide by zero. The calculator returns n/a in that case, since conditioning on an impossible event has no meaning.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.