Actuarial Statistics · Expectations and conditional expectations
Conditional Distributions and Conditional Expectation Explained
Updated 11 October 2026 · Fact-checked
A conditional distribution is the distribution of X once you know Y = y. You find it by dividing the joint pmf or pdf by the marginal of Y. Conditional expectation E[X | Y = y] is the mean of that distribution. E[X | Y] is the same thing viewed as a random variable.
Understand Conditional Distributions and Conditional Expectation
Start with conditional probability. P(A | B) is the probability of A once you know B has happened. A conditional distribution does the same for a whole random variable. It tells you how X behaves when you are given the value of Y.
For discrete variables, take the joint pmf and fix Y = y. That gives a slice of the joint table. The slice does not add up to 1, so you divide by P(Y = y). The result is the conditional pmf of X given Y = y. For continuous variables the idea is the same. You divide the joint pdf by the marginal pdf of Y. You must treat y as a fixed number during this step.
Conditional expectation E[X | Y = y] is just the ordinary mean, calculated with the conditional distribution instead of the marginal one. You sum or integrate x times the conditional pmf or pdf. The answer is a number for each fixed y. It is usually a function of y.
Now replace the fixed y with the random variable Y. The function g(y) = E[X | Y = y] becomes g(Y) = E[X | Y]. This is a random variable, because it changes as Y changes. This is the main difference from conditional probability. A conditional probability is a single number about an event. A conditional expectation is a mean of a distribution, and E[X | Y] is itself random.
Why it matters: E[E[X | Y]] = E[X]. The same split also gives the total variance rule. You will use both when a model has layers, such as a claim count whose parameter is itself random.
Key rules to remember
- Conditional pmf
- p(x | y) = P(X = x, Y = y) ÷ P(Y = y)
- Needs P(Y = y) > 0. For fixed y, the values p(x | y) add up to 1 over x.
- Conditional pdf
- f(x | y) = f(x, y) ÷ f_Y(y)
- Needs f_Y(y) > 0. Get f_Y(y) by integrating the joint pdf over x. For fixed y, f(x | y) integrates to 1 over x.
- Conditional expectation (discrete)
- E[X | Y = y] = Σ x · p(x | y)
- Sum over all x with p(x | y) > 0.
- Conditional expectation (continuous)
- E[X | Y = y] = ∫ x · f(x | y) dx
- Integrate over the range of x given y. The limits can depend on y.
- Conditional expectation of a function
- E[h(X) | Y = y] = ∫ h(x) f(x | y) dx
- Use this for E[X² | Y = y] when you need a conditional variance.
- Conditional variance
- Var(X | Y = y) = E[X² | Y = y] − (E[X | Y = y])²
- Same as the usual variance formula, using conditional moments.
- Tower property
- E[E[X | Y]] = E[X]
- Use it to check your answer. Average E[X | Y = y] over the marginal of Y.
- Independence
- If X and Y are independent, f(x | y) = f_X(x) and E[X | Y] = E[X]
- Independence is sufficient. A constant E[X | Y] alone does not prove independence.
How to solve Conditional Distributions and Conditional Expectation questions
Use this order for any question on conditional distributions or conditional expectation from a joint distribution.
- 1Write down the joint pmf or pdf and its exact range. Check whether the range is rectangular or whether one variable's limits depend on the other.
- 2Find the marginal of the variable you are conditioning on. For Y, sum or integrate the joint over x. Keep the limits correct.
- 3Divide the joint by this marginal to get the conditional pmf or pdf of X given Y = y.
- 4Check the result. For fixed y it must add up or integrate to 1. State the range of x for that y.
- 5Compute E[X | Y = y] by summing or integrating x times the conditional pmf or pdf. For a variance, also compute E[X² | Y = y].
- 6Substitute the specific y if the question gives one. If it asks for E[X | Y], write the answer as a function of Y.
- 7Check with the tower property if time allows: E[E[X | Y]] should equal E[X].
Quickest way: Slice, rescale, then average
When to use it: Use this for discrete joint tables or when the question gives a specific value of y.
- For a table, pick the row or column for the given y. Add it up to get P(Y = y).
- Divide each entry by that total. These are the conditional probabilities.
- Multiply each x by its conditional probability and add up.
- For a continuous joint pdf with a given y, substitute y into the joint pdf first. The result is a function of x. Its integral over x is f_Y(y).
- Integrate x times that function over x, then divide by f_Y(y). You get E[X | Y = y] without writing the full conditional pdf.
Common mistakes in Conditional Distributions and Conditional Expectation
Using the joint pmf or pdf directly as the conditional distribution.
The slice looks like a distribution, but it does not add up to 1.
Fix: Always divide by the marginal of Y. Check that the conditional sums or integrates to 1.
Dividing by the wrong marginal, for example f_X(x) instead of f_Y(y).
The notation f(x | y) makes it easy to mix up which variable is being conditioned on.
Fix: The variable after the bar is the one you divide by. For X given Y, divide by f_Y(y).
Integrating x over the wrong limits, for example 0 to 1 when the support is 0 < x < y.
Students copy the limits from the marginal and forget that the support depends on y.
Fix: Draw the region of the joint support. Read off the range of x for a fixed y before integrating.
Treating E[X | Y] as a number.
Students mix it up with E[X | Y = y].
Fix: E[X | Y = y] is a number for a given y. E[X | Y] is a function of Y, so it is a random variable. Write it in terms of Y.
Computing the conditional variance as E[X | Y = y] squared, or forgetting to subtract the squared mean.
Students rush and apply only half of the variance formula.
Fix: Find E[X² | Y = y] separately, then subtract (E[X | Y = y])².
Assuming E[X | Y = y] equals E[X].
Students treat the variables as independent without checking.
Fix: Only assume this if X and Y are independent. Otherwise compute the conditional mean.
Worked examples
Example 1
The joint pdf of X and Y is f(x, y) = x + y for 0 < x < 1 and 0 < y < 1, and 0 otherwise. (a) Find the conditional pdf of X given Y = y. (b) Find E[X | Y = y]. (c) Check using the tower property.
Show the solution
- Find the marginal of Y: f_Y(y) = ∫ from 0 to 1 of (x + y) dx = 1/2 + y, for 0 < y < 1.
- Conditional pdf: f(x | y) = (x + y) ÷ (y + 1/2), for 0 < x < 1.
- Check: ∫ from 0 to 1 of (x + y) dx = y + 1/2, so the conditional pdf integrates to 1.
- Conditional mean: E[X | Y = y] = ∫ from 0 to 1 of x(x + y) dx ÷ (y + 1/2).
- The numerator is 1/3 + y/2 = (2 + 3y)/6. The denominator is (2y + 1)/2.
- So E[X | Y = y] = (2 + 3y)/6 × 2/(2y + 1) = (2 + 3y) ÷ (3(2y + 1)).
- Check at y = 0: the conditional pdf is 2x, with mean 2/3. The formula gives 2/3.
- Tower check: E[X] = E[E[X | Y]] = ∫ from 0 to 1 of (1/3 + y/2) dy = 1/3 + 1/4 = 7/12. Directly, f_X(x) = x + 1/2, so E[X] = ∫ x(x + 1/2) dx = 1/3 + 1/4 = 7/12. They agree.
Answer: (a) f(x | y) = (x + y) ÷ (y + 1/2) for 0 < x < 1. (b) E[X | Y = y] = (2 + 3y) ÷ (3(2y + 1)). (c) Both routes give E[X] = 7/12.
Example 2
X takes values 0, 1, 2 and Y takes values 0, 1. The joint probabilities P(X = x, Y = y) are: P(0,0) = 0.10, P(1,0) = 0.20, P(2,0) = 0.20, P(0,1) = 0.10, P(1,1) = 0.25, P(2,1) = 0.15. (a) Find the conditional distribution of X given Y = 1. (b) Find E[X | Y = 1] and Var(X | Y = 1). (c) Find E[X].
Show the solution
- Check the table: 0.10 + 0.20 + 0.20 + 0.10 + 0.25 + 0.15 = 1.
- P(Y = 1) = 0.10 + 0.25 + 0.15 = 0.50.
- Conditional pmf given Y = 1: P(X = 0 | Y = 1) = 0.10 ÷ 0.50 = 0.2. P(X = 1 | Y = 1) = 0.25 ÷ 0.50 = 0.5. P(X = 2 | Y = 1) = 0.15 ÷ 0.50 = 0.3. These add up to 1.
- E[X | Y = 1] = 0(0.2) + 1(0.5) + 2(0.3) = 1.1.
- E[X² | Y = 1] = 0(0.2) + 1(0.5) + 4(0.3) = 1.7.
- Var(X | Y = 1) = 1.7 − 1.1² = 1.7 − 1.21 = 0.49.
- For E[X], first find E[X | Y = 0]. P(Y = 0) = 0.50, so the conditional pmf is 0.2, 0.4, 0.4 and E[X | Y = 0] = 0.4 + 0.8 = 1.2.
- E[X] = 0.5(1.2) + 0.5(1.1) = 1.15.
Answer: (a) P(X = 0, 1, 2 | Y = 1) = 0.2, 0.5, 0.3. (b) E[X | Y = 1] = 1.1 and Var(X | Y = 1) = 0.49. (c) E[X] = 1.15.
Exam tips
- Always state the range of x for the given y before integrating. Marks are often given for the correct support.
- Show the marginal of Y and the division step. Even if you slip on the final integral, the method marks are safe.
- Use the tower property as a quick check on your answer, and as a shortcut when the question asks for E[X] in a layered model.
- In multiple-choice questions, check whether the answer must be a number or a function of y. This often removes two options.
- In written questions, write E[X | Y] as a function of Y when asked. Do not substitute a value unless the question gives one.
Practice questions from Expectations and conditional expectations
- X is uniform on (0, 6). What is E[X²]?
- Let N be Poisson with mean 3, and given N = n, S is the sum of n independent claims each with mean 100 and variance 400 (S = 0 if n = 0). Wh…
- X and Y are random variables with E[Y|X] = 3 + 2X, E[X] = 5 and Var(X) = 4. What is E[Y] and Cov(X,Y)?
- Let X be uniform on (0, 10) and let Y = min(X, 4), representing a claim capped at Rs 4 lakh. What is E[Y]?
- Given Λ = λ, the claim count N is Poisson(λ). Λ has an exponential distribution with mean 2. What is Var(N)?
Conditional Distributions and Conditional Expectation in other exams
The same ground in other exams, if you are preparing for more than one or want another angle on it.
Conditional Distributions and Conditional Expectation: frequently asked questions
How do I find the conditional distribution of X given Y?
Divide the joint pmf or pdf by the marginal of Y. For a pdf, that is f(x | y) = f(x, y) ÷ f_Y(y), valid where f_Y(y) > 0. Then state the range of x for that y and check that it sums or integrates to 1.
What is the difference between conditional probability and conditional expectation?
Conditional probability gives the chance of an event given some information. Conditional expectation gives the mean of a random variable given that information. E[X | Y = y] is a number for each y, and E[X | Y] is a random variable.
Is E[X | Y] a random variable?
Yes. It is a function of Y, so it takes different values as Y changes. Its expected value is E[X], by the tower property.
How do I get E[X | Y = y] from a joint pdf quickly?
Fix y in the joint pdf and integrate x times f(x, y) over the range of x. Divide by f_Y(y), which is the integral of f(x, y) over x. This avoids writing out the full conditional pdf.