Tutorials › Statistical Theory I - Probability and Distribution Theory › Conditional Means Given an Event

Conditional Expectation · Tutorial 323 of 994

Conditional Means Given an Event

Learn to calculate and interpret a random variable’s mean after restricting attention to an event of positive probability.

Intermediate 10 min read

What You'll Learn

  • Define the conditional mean given an event and check when it is finite.
  • Obtain a conditional mass function or density by restricting and renormalizing the original law.
  • Calculate conditional means for discrete and continuous threshold events.
  • Combine conditional means across disjoint pieces of an event.
  • Recognize why conditioning on a probability-zero event is not covered by this definition.

Why Condition on an Event?

An unconditional mean describes a distribution as a whole. In many problems, however, the quantity of interest is the average only among outcomes satisfying a specified condition: the waiting time given that it exceeds a threshold, or the number of successes given that it is at least two. The key calculation is to restrict the distribution to the event and then renormalize it so the restricted probabilities add to one.

This tutorial treats conditioning on a single event of positive probability. The result is an ordinary number, not a random variable. Throughout, assume \(X\) is integrable, meaning \(E[|X|]<\infty\), and let \(A\) be an event with \(P(A)>0\).

Definition and Basic Formula

Definition: The conditional mean of \(X\) given the event \(A\) is $$ E[X\mid A]=\frac{E[X\mathbf{1}_A]}{P(A)}, $$ where \(\mathbf{1}_A\) is 1 on \(A\) and 0 outside \(A\). Equivalently, it is the mean under the conditional distribution \(P(X\in C\mid A)=P(\{X\in C\}\cap A)/P(A)\), for measurable sets \(C\).

The indicator in the numerator keeps the values of \(X\) on \(A\) and discards its values outside \(A\). Division by \(P(A)\) accounts for the fact that those retained outcomes had total probability \(P(A)\), rather than 1, under the original distribution.

This mean is finite under the stated assumptions. In fact, $$ E[|X|\mid A]=\frac{E[|X|\mathbf{1}_A]}{P(A)} \leq \frac{E[|X|]}{P(A)}<\infty. $$ The definition therefore applies to integrable \(X\) and any positive-probability event \(A\), whether or not \(A\) is specified using \(X\) alone.

Conditional Mass Functions and Densities

If \(X\) has a countable support and \(A\) is an event, its conditional mass at \(x\) is \(P(X=x\mid A)=P(\{X=x\}\cap A)/P(A)\). Thus the conditional mean is the sum of \(x\) times these conditional masses. In the common case \(A=\{X\in B\}\), only support points in \(B\) remain.

$$ E[X\mid A] =\sum_x x\,P(X=x\mid A) =\frac{\sum_x x\,P(X=x,A)}{P(A)}. $$

For a continuous variable, if the joint restriction to \(A\) has a density \(h_A\), this means that \(P(X\in C,A)=\int_C h_A(x)\,dx\) for every measurable set \(C\). The conditional density is \(h_A(x)/P(A)\). In particular, if \(X\) has density \(f\) and \(A=\{X\in B\}\), then \(h_A(x)=f(x)\mathbf{1}_B(x)\). Consequently:

$$ f_{X\mid A}(x)=\frac{f(x)\mathbf{1}_B(x)}{P(X\in B)}, \qquad E[X\mid A] =\frac{\int_B x f(x)\,dx}{\int_B f(x)\,dx}, \qquad P(X\in B)>0. $$

These formulas express the same operation in different forms: retain probability mass or density on the event, then divide by the event’s probability. The conditional distribution need not have the same family or shape as the original distribution.

Worked Example: A Binomial Count Above a Threshold

Let \(X\sim\operatorname{Bin}(5,0.2)\), and condition on \(A=\{X\geq 2\}\). Calculate \(E[X\mid A]\) from the conditional mass function.

The binomial probabilities for \(x=0,1,2,3,4,5\), respectively, are \(0.32768,\ 0.40960,\ 0.20480,\ 0.05120,\ 0.00640,\ 0.00032\). They sum to 1. On \(A\), only \(x=2,3,4,5\) remain, so

$$ P(A)=0.20480+0.05120+0.00640+0.00032=0.26272. $$

The conditional masses at those four points are the original masses divided by \(0.26272\). Using the ratio formula avoids rounding those conditional masses:

$$ E[X\mid A] =\frac{2(0.20480)+3(0.05120)+4(0.00640)+5(0.00032)} {0.26272} =\frac{0.59040}{0.26272} =\frac{1845}{821} \approx 2.2473. $$

The answer is above the threshold 2, as it must be, and below 5, the largest possible value on the event. These bounds provide a quick check on the calculation.

Worked Example: An Exponential Waiting Time Exceeding a Threshold

Let \(T\) have an exponential distribution with rate 2, so its density is \(f(t)=2e^{-2t}\) for \(t\geq 0\). Find the mean waiting time given \(T>1\).

The event probability is \(P(T>1)=\int_1^\infty 2e^{-2t}\,dt=e^{-2}\). The numerator is evaluated by integration by parts:

$$ \begin{aligned} E[T\mathbf{1}_{\{T>1\}}] &=\int_1^\infty 2t e^{-2t}\,dt\\ &=\left[-t e^{-2t}\right]_1^\infty+\int_1^\infty e^{-2t}\,dt\\ &=e^{-2}+\frac{e^{-2}}{2} =\frac{3}{2}e^{-2}. \end{aligned} $$

The boundary term at infinity is zero because \(t e^{-2t}\to 0\). Dividing by the event probability gives

$$ E[T\mid T>1]=\frac{(3/2)e^{-2}}{e^{-2}}=\frac{3}{2}. $$

The conditional density is \(2e^{-2(t-1)}\) for \(t>1\), which also shows that the conditional waiting time has been shifted to begin at 1. Its mean, 1.5, is consistent with that support.

Two Useful Identities

The mass-function and density calculations are instances of a general integration identity. It justifies using a conditional distribution to compute the conditional mean, including when the event is not simply a threshold on \(X\).

Result: Let \(Q_A(C)=P(X\in C\mid A)\) for measurable \(C\). If \(E[|X|]<\infty\) and \(P(A)>0\), then \(X\) is integrable under \(Q_A\) and $$ \int x\,Q_A(dx)=\frac{E[X\mathbf{1}_A]}{P(A)}=E[X\mid A]. $$

Proof. For an indicator function \(\mathbf{1}_C\), the identity follows directly from the definition: \(\int \mathbf{1}_C(x)\,Q_A(dx)=P(X\in C\mid A)=E[\mathbf{1}_{\{X\in C\}}\mathbf{1}_A]/P(A)\). By addition and multiplication by nonnegative constants, the same equality holds for nonnegative simple functions. Every nonnegative measurable function is the increasing limit of nonnegative simple functions, so the monotone convergence theorem extends the equality to every nonnegative measurable function \(g\):

$$ \int g(x)\,Q_A(dx)=\frac{E[g(X)\mathbf{1}_A]}{P(A)}. $$

Apply this identity to \(g(x)=|x|\). The right-hand side is finite because \(E[|X|]<\infty\) and \(P(A)>0\); hence \(X\) is integrable under \(Q_A\). Applying the identity separately to the positive and negative parts of \(X\), and subtracting their finite integrals, gives the asserted identity for \(x\). \(\square\)

A second identity is useful when an event is split into disjoint pieces. Suppose \(A\) is the union of finitely many pairwise disjoint events \(A_1,\ldots,A_m\). For each piece with positive probability, its own conditional mean is defined.

Result: With zero-probability pieces omitted, $$ E[X\mid A]=\sum_{j:P(A_j)>0}P(A_j\mid A)\,E[X\mid A_j]. $$

Proof. Since the events are disjoint and have union \(A\), their indicators add to \(\mathbf{1}_A\). Linearity of expectation for this finite sum gives \(E[X\mathbf{1}_A]=\sum_j E[X\mathbf{1}_{A_j}]\). For each positive-probability piece, the definition gives \(E[X\mathbf{1}_{A_j}]=P(A_j)E[X\mid A_j]\); a zero-probability piece contributes zero. Divide the resulting sum by \(P(A)\), and use \(P(A_j\mid A)=P(A_j)/P(A)\). This yields the identity. \(\square\)

Worked Example: Conditioning on Two Disjoint Ranges

Let \(X\) be uniform on \((0,10)\), and let \(A=\{X\leq 2\}\cup\{X>6\}\). Find the conditional mean by separating the two disjoint pieces.

The density is \(1/10\) on \((0,10)\). The two pieces have probabilities \(2/10=0.2\) and \(4/10=0.4\), so \(P(A)=0.6\). Their conditional probabilities within \(A\) are \(0.2/0.6=1/3\) and \(0.4/0.6=2/3\). Within the first range the mean is \((0+2)/2=1\); within the second it is \((6+10)/2=8\). Therefore,

$$ E[X\mid A]=\frac{1}{3}(1)+\frac{2}{3}(8)=\frac{17}{3}\approx 5.667. $$

A direct density calculation checks the result. The conditional density is \(1/6\) on the two ranges and zero elsewhere, because \((1/10)/0.6=1/6\). Thus

$$ E[X\mid A] =\frac{1}{6}\left(\int_0^2 x\,dx+\int_6^{10}x\,dx\right) =\frac{1}{6}\left(2+32\right) =\frac{17}{3}. $$

The two approaches agree. The weights in the first calculation are the probabilities of each piece relative to the event \(A\), not their probabilities in the original population.

Common Mistakes and Interpretation

  • Forgetting to divide by \(P(A)\). \(E[X\mathbf{1}_A]\) is the contribution of the event to the unconditional mean, not the mean within the event. The conditional mean is that contribution divided by the event probability.
  • Keeping the original normalization. When restricting a density to a range, its integral is generally less than 1. Divide the restricted density by the probability of that range before treating it as a conditional density.
  • Using an event of probability zero in this definition. If \(P(A)=0\), the ratio is undefined. Conditioning on an exact value of a continuous random variable requires a different framework; it is not justified by substituting that event into this formula.
  • Assuming the conditional mean must equal the threshold. Conditioning on \(X>c\) retains values above \(c\), but the mean depends on how probability is distributed above \(c\). Compute it from the conditional law or the ratio formula.

Conditional means summarize selected parts of a distribution and are useful whenever a question concerns a population restricted by an observed condition. A reliable calculation starts by identifying the event, checking that it has positive probability, and then normalizing the restricted mass or density. For a partition, check that the mixture weights are conditional probabilities within the event and sum to 1.

Check Your Understanding

For each question, identify the relevant event and use its conditional distribution or the event-ratio formula.

  1. If \(X\) is integrable and \(P(A)>0\), write the definition of \(E[X\mid A]\). Explain why it is finite.
  2. Suppose \(X\) has density \(f\), and \(P(X\in B)>0\). What is the density of \(X\) given \(X\in B\)?
  3. A count \(X\) takes values 0, 1, and 2 with probabilities \(0.5, 0.3,\) and \(0.2\). Find \(E[X\mid X\geq 1]\).
  4. Why is \(E[X\mathbf{1}_A]\) not, by itself, the conditional mean given \(A\)?
  5. If an event is the disjoint union of two positive-probability pieces, what weights combine the two conditional means to give the mean on the full event?