For a bivariate random variable, compute the expected value of one of its components given the other.
The idea
The conditional expected value of Y given that X takes the value x is the mean of Y under the conditional probability mass function. Conditional mean = Σ y × f(y | x). The conditional probability is f(y | x) = f(x, y) ÷ fX(x), the cell probability divided by the row total. In the matrix, take the row for x, divide it by its total so it sums to 1, and average the y values with those weights. Conditioning on an event such as X ≥ 1 works the same way, using the combined probability of the event as the divisor. If X and Y are independent, E(Y | x) equals E(Y) for every x. Once X is fixed at x, it acts as a constant, so E(g(X) + hY | x) = g(x) + h × E(Y | x). A frequent slip is forgetting to divide by the row total.
Formulas
Conditional expected value from a joint pmf
E(Y | X = x) = Σ y × f(x, y) ÷ fX(x)
- y
- each value of Y
- f(x, y)
- the joint probability in the row for x
- fX(x)
- the row total, P(X = x)
Forgetting to divide by the row total is the frequent slip. If X and Y are independent the result is E(Y) for every x.
A practice question
For a discrete bivariate random variable, how is the conditional expected value E[Y | X = x] computed?
- Weight each value y by the joint probability f(x, y) and add over y, without dividing by anything.Why not: Uses joint probabilities that sum to f_X(x) rather than 1; the result is E[Y x 1(X = x)], not the conditional mean.
- Weight each value y by the marginal probability f_Y(y) and add over y.Why not: Gives the unconditional mean E[Y]; the condition X = x is ignored.
- Weight each value y by the conditional probability f(y | x) = f(x, y) / f_X(x) and add over y. - correct
- Take the most likely value of y given X = x.Why not: Describes the conditional mode; the conditional mean is a probability-weighted average of all values.
Conditioning on X = x restricts attention to the row f(x, .) and rescales it to a pmf, f(y | x) = f(x, y) / f_X(x). Then E[Y | X = x] = sum over y of y f(y | x).
A harder one
X takes the values 1, 2, 3 with probabilities 0.50, 0.30, 0.20. The conditional means are E[Y | X = 1] = 10, E[Y | X = 2] = 20 and E[Y | X = 3] = 40. What is E[Y]?
- 23.33Why not: Averages the three conditional means with equal weights instead of the probabilities of X.
- 28Why not: Applies the probabilities in reverse order, pairing the largest weight with the largest conditional mean.
- 20Why not: Picks the conditional mean for the middle value of X; the unconditional mean needs all three conditional means weighted by P(X).
- 19 - correct
By the law of iterated expectations, E[Y] = E[E[Y | X]] = 0.50(10) + 0.30(20) + 0.20(40) = 5 + 6 + 8 = 19.
The hardest tier
X takes values 0, 1, 2 and Y takes values 1, 2, 5. The joint pmf by row is: X = 0: 0.10, 0.10, 0.05; X = 1: 0.10, 0.20, 0.10; X = 2: 0.05, 0.10, 0.20 (columns Y = 1, 2, 5). What is E[Y | X >= 1]?
- 2.80Why not: Computes the unconditional E[Y], ignoring the event X >= 1.
- 2.25Why not: Weights the y-values by joint probabilities over the event X >= 1 without dividing by P(X >= 1) = 0.75.
- 2.50Why not: Conditions on X = 1 only, not on the event X >= 1, which also includes X = 2.
- 3.00 - correct
P(X >= 1) = 0.40 + 0.35 = 0.75. The y-weighted sum over those rows is 1(0.15) + 2(0.30) + 5(0.30) = 2.25. Divide: 2.25 / 0.75 = 3.00.
In the app: 6 practice questions on this outcome, spaced review that brings it back before you forget it.
Start free →More in Multivariate Random Variables
- Express a probability mass function through a probability matrix and explain how this works.
- From a discrete bivariate random variable, obtain both its marginal and its conditional distributions.
- Describe the way an expected value of a function is obtained for a discrete bivariate random variable.
- Give the definition of covariance and say what quantity it captures.
- Describe how covariance and correlation of two random variables relate to each other and to whether the variables are independent.
- Show, with examples, what happens to the covariance and correlation of two random variables when linear transformations are applied to them.
- Find the variance when two random variables are combined using weights.
- Identify what makes a sequence of random variables independent and identically distributed (iid).
- Illustrate why, for iid random variables, the mean and variance of their sum are easier to calculate.