A Reliable Strategy for Discrete Conditioning
A discrete conditional-expectation problem often involves several layers: a joint distribution, a conditioning variable, and an event whose probability or expected count is wanted. The arithmetic is usually simple once the conditioning information is made explicit. The main challenge is to keep the conditional law, the event being averaged over, and the final averaging weights distinct.
For a finite- or countably-valued variable \(X\), conditioning on \(Y=y\) means using the distribution of \(X\) among outcomes for which \(Y=y\). This conditional distribution is defined by ratios of joint probabilities when \(P(Y=y)>0\). Values \(y\) with \(P(Y=y)=0\) do not contribute to unconditional averages and do not have a conditional distribution defined by that ratio.
For a nonnegative integer-valued count, an expectation is a weighted sum over all its possible counts. For a finite-valued variable, the sum is finite. For a countably-valued integrable variable, the sum converges absolutely, since \( \sum_x |x|P(X=x)=E[|X|]<\infty \). This distinction matters when proving a formula: a finite-sum argument alone does not prove the same statement for every countably supported variable.
Conditional Mass Functions and an Event Partition
When a joint probability table is available, first add the joint probabilities across each row or column to get the marginal probability of the conditioning value. Divide the joint entries by that marginal to get the conditional mass function. Then calculate the requested conditional expectation from that mass function.
Worked Example: Conditional Means From a Joint Table
Suppose \(X\) takes values \(0,1,2\), and \(Y\) takes values \(0,1\). Their joint probabilities are shown below. Find \(E[X\mid Y=0]\), \(E[X\mid Y=1]\), \(E[X]\), and \(P(X\geq 1\mid Y=1)\).
| \(X=0\) | \(X=1\) | \(X=2\) | Total | |
|---|---|---|---|---|
| \(Y=0\) | 0.1 | 0.2 | 0.1 | 0.4 |
| \(Y=1\) | 0.1 | 0.2 | 0.3 | 0.6 |
| Total | 0.2 | 0.4 | 0.4 | 1 |
The row totals give \(P(Y=0)=0.4\) and \(P(Y=1)=0.6\). Thus, for \(Y=0\), the conditional probabilities of \(X=0,1,2\) are \(0.1/0.4=0.25\), \(0.2/0.4=0.5\), and \(0.1/0.4=0.25\). Therefore
For \(Y=1\), the conditional probabilities are \(0.1/0.6=1/6\), \(0.2/0.6=1/3\), and \(0.3/0.6=1/2\). Hence
The marginal probabilities of \(X=0,1,2\) are \(0.2,0.4,0.4\), so \(E[X]=0(0.2)+1(0.4)+2(0.4)=1.2\). The conditional probability requested is
As a check, averaging the two conditional means using the probabilities of the conditioning values gives \(0.4(1)+0.6(4/3)=1.2\), agreeing with the direct marginal calculation of \(E[X]\).
More generally, conditioning on a discrete variable separates an expectation into contributions from the events \(Y=y\). The following result holds even when \(X\) has countably many possible values.
Proof. Write \(p_{xj}=P(X=x,Y=y_j)\) and \(q_j=P(Y=y_j)\). For every \(j\) with \(q_j>0\), \(q_jE[X\mid Y=y_j]=\sum_x xp_{xj}\). The sums over \(x\) are absolutely convergent: their absolute sums are bounded by \(\sum_x |x|P(X=x)=E[|X|]<\infty\). There are only finitely many values of \(Y\), so we may add these absolutely convergent sums and rearrange them:
Terms with \(q_j=0\) have \(p_{xj}=0\) for every \(x\), so omitting those \(j\) does not change the sum. This proves the result. \(\square\)
Indicators Turn Events Into Expectations
An event \(A\) can be represented by its indicator \(I_A\), which equals \(1\) when \(A\) occurs and \(0\) otherwise. The identity \(E[I_A]=P(A)\) turns event-probability questions into expectation questions. In a discrete conditional calculation, the corresponding identity is \(E[I_A\mid Y=y]=P(A\mid Y=y)\) whenever \(P(Y=y)>0\).
To verify the identity, under the conditional distribution given \(Y=y\), the indicator is \(1\) on \(A\) and \(0\) off \(A\). Its conditional mean is therefore the conditional probability of \(A\):
For several events, a count can often be written as a sum of indicators. If \(N\) counts how many of \(A_1,\ldots,A_k\) occur, then \(N=\sum_{i=1}^k I_{A_i}\). The expectation of that count is the sum of the event probabilities, without requiring the events to be independent. The same calculation works conditionally.
Worked Example: A Count in a Two-Draw Experiment
An urn contains three red balls and two blue balls. Two balls are drawn without replacement. Let \(X\) be the number of red balls drawn, and let \(A\) be the event that the first ball is red. Find the conditional distribution and conditional mean of \(X\) given \(A\), do the same given \(A^c\), and use the partition \(\{A,A^c\}\) to recover \(E[X]\).
The event \(A\) has probability \(3/5\), while \(A^c\) has probability \(2/5\). Given \(A\), one red ball has already been drawn. Of the four balls remaining, two are red and two are blue. Thus \(X=2\) if the second ball is red, with probability \(2/4=1/2\); otherwise \(X=1\), with probability \(1/2\). Consequently,
Given \(A^c\), the first ball was blue. The remaining four balls include three red and one blue. Thus \(X=1\) with probability \(3/4\) and \(X=0\) with probability \(1/4\), giving
The event partition gives \(E[X]=(3/5)(3/2)+(2/5)(3/4)=9/10+3/10=6/5\). This matches the indicator calculation. Let \(I_1\) and \(I_2\) indicate that the first and second draws, respectively, are red. Then \(X=I_1+I_2\); each draw has probability \(3/5\) of being red, so \(E[X]=E[I_1]+E[I_2]=3/5+3/5=6/5\).
The indicators are useful here because the count is a sum of event indicators. No independence assumption is needed to add their expectations.
Conditioning on a Random Count
A common multi-step problem first generates a random number of opportunities and then generates outcomes within those opportunities. The conditional distribution given the count describes the second stage; averaging over the count accounts for the first stage. Keep these stages separate until the final sum.
Worked Example: A Binomial Count With a Random Number of Trials
Suppose \(N\) has probabilities \(P(N=0)=0.2\), \(P(N=1)=0.5\), and \(P(N=2)=0.3\). Given \(N=n\), let \(K\) have a binomial distribution with \(n\) trials and success probability \(0.4\). Find \(E[K]\), the mass function of \(K\), and \(E[K\mid K>0]\).
Given \(N=n\), the conditional mean is \(E[K\mid N=n]=0.4n\). The mean of \(N\) is \(E[N]=0(0.2)+1(0.5)+2(0.3)=1.1\). Averaging the conditional means gives
For the full mass function, if \(N=0\), then \(K=0\) with probability \(1\). If \(N=1\), the probabilities of \(K=0,1\) are \(0.6,0.4\). If \(N=2\), the probabilities of \(K=0,1,2\) are \(0.6^2=0.36\), \(2(0.4)(0.6)=0.48\), and \(0.4^2=0.16\). Averaging each value over \(N\) gives
These probabilities sum to \(0.608+0.344+0.048=1\). Therefore \(P(K>0)=0.344+0.048=0.392\), and
The numerator \(0.440\) is \(E[K]\), since the \(K=0\) outcome contributes nothing. The conditional mean is larger than \(E[K]\), as expected after restricting to positive counts.
Putting the Calculations Together
For a multi-step discrete problem, write down the conditioning values and their probabilities before computing any conditional means. Then identify the conditional mass function needed at each value. If the target is a probability, use an indicator or sum the relevant conditional masses. If the target is an expectation, calculate the conditional mean and average it with the probabilities of the conditioning values.
List the possible values or partition events, and record their probabilities. Exclude zero-probability cases from conditional ratios.
Use joint probabilities divided by the conditioning probability, or use the stated conditional model.
Sum values times conditional masses for a mean, or sum the masses of the values in the event for a probability.
Average conditional means using the conditioning probabilities; for a mean restricted to an event, divide the event-weighted expectation by the event probability.
Check that a conditional mass function sums to one and compare an unconditional expectation with a direct marginal or indicator calculation when available.
Common Mistake
A frequent error is to compute conditional means correctly but then average them with equal weights. For instance, in the joint-table example, the two conditional means are \(1\) and \(4/3\). Their unweighted average is \(7/6\), which is not \(E[X]\). The conditioning cases have probabilities \(0.4\) and \(0.6\), not \(1/2\) and \(1/2\); the correct weighted average is \(0.4(1)+0.6(4/3)=1.2\).
Another error is to treat a conditional probability as if it were the unconditional probability of the same event. For example, \(P(X\geq1\mid Y=1)\) is obtained from the \(Y=1\) row alone, with that row normalized to total one. Using the joint entries \(0.2+0.3\) without dividing by \(P(Y=1)=0.6\) gives \(P(X\geq1,Y=1)\), not the conditional probability.
Check Your Understanding
For each problem, identify the relevant conditional distribution or event weights before calculating.
- If \(P(Y=0)=0.3\), \(P(Y=1)=0.7\), \(E[X\mid Y=0]=2\), and \(E[X\mid Y=1]=5\), find \(E[X]\).
- Explain why the conditional mass function \(P(X=x\mid Y=y)\) cannot be obtained by dividing by \(P(X=x)\).
- Let \(N\) count how many of four events occur. Write \(N\) as a sum of indicators and state the expectation of \(N\) in terms of the event probabilities.
- If \(P(A)=0.2\), \(E[X\mid A]=4\), and \(E[X\mid A^c]=1\), find \(E[X]\), assuming \(X\) is integrable.
- Why does the discrete tower calculation remain valid for countably supported \(X\) when \(Y\) has finite support and \(E[|X|]<\infty\)?