← Back to Blog
Exam Guides2026-09-257 min read

Expected Value and Variance: Computational Techniques for Exam P

Master computational shortcuts for expected values and variances on Exam P.

The Shortcut Variance Formula

The most important computational formula on Exam P is Var(X) = E[X^2] - (E[X])^2. This shortcut avoids computing E[(X - mu)^2] directly, which requires knowing mu first and typically involves harder integrals. On Exam P, always compute E[X] and E[X^2] separately as two independent calculations, then combine them.

For linear transformations: E[aX + b] = a*E[X] + b and Var(aX + b) = a^2 * Var(X). The constant b shifts the mean but does not affect variance. These properties follow from the linearity of expectation and the definition of variance.

A useful extension: if X and Y are independent, then E[XY] = E[X]*E[Y] and Var(XY) = Var(X)*Var(Y) + Var(X)*(E[Y])^2 + Var(Y)*(E[X])^2. This product variance formula appears occasionally on Exam P when you need the variance of a product of independent variables.

Another helpful identity: Var(X) = E[X(X-1)] + E[X] - (E[X])^2. This is useful when the factorial moment E[X(X-1)] has a simpler form than E[X^2], which is the case for many discrete distributions (Binomial, Poisson, Negative Binomial).

The Law of the Unconscious Statistician (LOTUS)

LOTUS states that E[g(X)] = sum of g(x)*p(x) for discrete X or integral of g(x)*f(x) dx for continuous X. The key insight is that you do not need to find the distribution of g(X) first. You compute the expectation directly using the original distribution of X. This saves significant time on Exam P.

Example: If X ~ Uniform(0, 2) and you need E[e^X], compute integral from 0 to 2 of e^x * (1/2) dx = (1/2)(e^2 - 1) = 3.1945. You do not need to find the distribution of e^X (which would be more complex).

LOTUS is especially useful for computing E[X^2] when you need the variance. Instead of finding the distribution of X^2 and then computing its mean, simply compute E[X^2] = integral of x^2 * f(x) dx or sum of x^2 * p(x). This is almost always faster.

For functions of two variables, LOTUS extends naturally: E[g(X, Y)] = double integral of g(x, y) * f(x, y) dx dy for continuous (X, Y) or double sum for discrete. This is used to compute E[XY], E[X + Y], E[max(X, Y)], and other functions of joint distributions.

Indicator Random Variables

Indicator random variables are one of the most powerful tools for computing expectations of counts on Exam P. An indicator I_A takes value 1 when event A occurs and 0 otherwise. Its expected value E[I_A] = P(A) and variance Var(I_A) = P(A)(1 - P(A)).

The power of indicators comes from expressing a count as a sum: if N counts how many of the events A1, ..., An occur, then N = I_1 + I_2 + ... + I_n. By linearity of expectation, E[N] = sum of P(Ai). This works regardless of whether the events are independent.

Example: A standard deck of 52 cards is dealt to 4 players (13 each). What is E[number of players who receive at least one ace]? Let I_j = 1 if player j gets at least one ace. By symmetry, P(I_j = 1) = 1 - C(48, 13)/C(52, 13) for each j. Then E[N] = 4 * P(I_1 = 1). The indicator approach makes this problem straightforward.

For the variance of a count: Var(N) = sum of Var(I_i) + 2 * sum over i < j of Cov(I_i, I_j). Each covariance is Cov(I_i, I_j) = P(Ai and Aj) - P(Ai)*P(Aj). When the events are independent, the covariance terms vanish and Var(N) = sum of P(Ai)(1 - P(Ai)).

The Conditional Expectation Approach

When a problem has a natural conditioning variable, the tower property E[X] = E[E[X|Y]] often simplifies calculations dramatically. The idea is to choose Y such that E[X|Y] is easy to compute, then take its expectation over Y.

Similarly, the total variance formula Var(X) = E[Var(X|Y)] + Var(E[X|Y]) decomposes the variance into within-group and between-group components. Both formulas are essential for hierarchical models on Exam P.

Example: A fair coin is tossed. If heads, X ~ Poisson(3). If tails, X ~ Poisson(7). Find E[X] and Var(X). Let Y be the coin outcome. E[X|heads] = 3, E[X|tails] = 7. E[X] = 0.5(3) + 0.5(7) = 5. Var(X|heads) = 3, Var(X|tails) = 7. E[Var(X|Y)] = 0.5(3) + 0.5(7) = 5. Var(E[X|Y]) = 0.5(3^2) + 0.5(7^2) - 5^2 = 29 - 25 = 4. Var(X) = 5 + 4 = 9.

The conditioning variable is often a discrete type indicator (as in the example above), a mixing parameter in a hierarchical model, or the number of claims in a compound model. Recognizing when conditioning simplifies a problem is a key skill on Exam P.

The Survival Function Method

For non-negative random variables, E[X] = integral from 0 to infinity of S(x) dx, where S(x) = P(X > x). This method avoids integration by parts and is particularly useful when the survival function has a simpler form than x * f(x).

The generalization E[X^n] = n * integral from 0 to infinity of x^(n-1) * S(x) dx provides higher moments. For the second moment specifically: E[X^2] = 2 * integral from 0 to infinity of x * S(x) dx.

Example: If S(x) = (1 - x/5)^2 for 0 < x < 5, then E[X] = integral from 0 to 5 of (1 - x/5)^2 dx. Substituting u = 1 - x/5: E[X] = 5 * integral from 0 to 1 of u^2 du = 5/3. Without the survival function method, you would need to find f(x) = (2/5)(1 - x/5) first, then integrate x * f(x), which involves more algebra.

Symmetry and Tail Balance

When a distribution is symmetric about a point c, then E[X] = c. This saves computation entirely for distributions like the Uniform(a, b) (symmetric about (a+b)/2) and the Normal(mu, sigma^2) (symmetric about mu). Recognizing symmetry is a quick check on your work as well.

For computing E[max(X, Y)] and E[min(X, Y)] when X and Y are identically distributed, the identity E[max(X, Y)] + E[min(X, Y)] = E[X] + E[Y] is useful. If you can compute one, you get the other for free.

Common Pitfalls

The most common error is computing Var(X) = E[X^2] - E[X]^2 and accidentally squaring the wrong quantity. Remember that (E[X])^2 is the square of the expected value, not E of the square. Keep track of the parentheses carefully.

Another frequent mistake is applying LOTUS incorrectly by finding the distribution of g(X) instead of computing E[g(X)] directly. While finding the distribution is not wrong, it is almost always slower and more error-prone. Use LOTUS as your default approach.

Students sometimes forget that linearity of expectation E[aX + bY] = aE[X] + bE[Y] holds for all random variables, regardless of dependence. Variance, however, requires knowing the covariance: Var(aX + bY) = a^2 Var(X) + b^2 Var(Y) + 2ab Cov(X, Y). The covariance term drops out only when X and Y are uncorrelated.

Study Tips

For Exam P, build a toolkit of computational techniques: the shortcut variance formula, LOTUS, indicator variables, conditional expectation, and the survival function method. For each problem, choose the technique that makes the calculation simplest. Practice recognizing which tool to use: conditioning works best for hierarchical models, indicators for counting, LOTUS for transformed variables, and the survival function method for non-negative variables with simple S(x). Aim to complete expectation and variance problems in three minutes or less on exam day.

Ready to practice?

Put this knowledge to work with flashcards and practice exams.

Start Studying Free