In this article
  1. Definitions and basics
  2. Linearity of expectation
  3. What does not follow from expected value
  4. The maximum of normal variables
  5. Expected value puzzles with Bayes and states
  6. Paradoxes and decisions
  7. Follow-up questions
  8. Sources

Definitions and basics

This list is one part of the probability and statistics interview guide; the wider list of probability interview questions covers events, conditional probability and counting.

What is expected value, and is it the most likely outcome?

For a discrete random variable the expected value is the sum of each value times its probability, E[X]=∑x·P(X=x) (Statistics LibreTexts, discrete random variables). It is a long-run weighted average, not the most likely outcome, and it can be an impossible value: the expected number of heads in one fair flip is 0.5.1 It also says nothing about spread; Chebyshev's inequality bounds that.

Why it is asked: it separates the formula from the meaning. Read the full explanation: StatLect, expected value.

How do you compute the expected value of a fair die roll?

Multiply each face by its probability of one sixth and add: (1 + 2 + 3 + 4 + 5 + 6) / 6 = 3.5.1 Lehman, Leighton and Meyer state in Mathematics for Computer Science that the expected value of one die is 3.5. No roll ever shows 3.5, which is the point of the previous question.

Why it is asked: it is the warm-up that shows whether you weight by probability. Read the full explanation: probability interview questions.

What is the expected value of a constant, and of aX + b?

The expected value of a constant is that constant (Statistics LibreTexts). Combined with linearity, E[aX + b] = a·E[X] + b. If a die roll is doubled and then 1 is added, the expected result is 2 × 3.5 + 1 = 8.1 Spread does not follow the same rule: Var(aX + b) = a²Var(X), so the shift b drops out and the scale a is squared.

Why it is asked: it tests whether you can rescale quickly without re-deriving. Read the full explanation: Statistics LibreTexts, expected value of a constant.

Linearity of expectation

What is linearity of expectation, and does it need independence?

Linearity of expectation is the rule that the expected value of a sum is the sum of the expected values: E[R1 + R2] = E[R1] + E[R2] for any random variables (Lehman, Leighton and Meyer, Theorem 18.5.1). It applies to sums of any random variables, independent or not (Indian Institute of Technology (IIT) Delhi chapter notes). No independence is needed.

Why it is asked: it is the main tool for counting puzzles, and the independence myth is a common trap. Read the full explanation: IIT Delhi chapter notes on linearity.

What is the expected value of the sum of two dice?

By linearity it is 3.5 + 3.5 = 7, with no table of 36 outcomes needed.1 The same answer holds if the two dice were somehow linked, because linearity does not require independence. Interviewers sometimes follow with "now roll a hundred dice", where the answer is 100 × 3.5 = 350 the same way.1

Why it is asked: it checks that you reach for linearity before enumeration. Read the full explanation: Mathematics for Computer Science, linearity of expectation.

How do you use indicator variables to count something in expectation?

An indicator variable is a random variable that equals 1 when an event happens and 0 otherwise, so its expected value is the probability of the event. To count matches, write the count as a sum of indicators and add their probabilities. In a random shuffle of n items, each position is fixed with probability 1/n, so the expected number of fixed points is n × 1/n = 1; exact enumeration for five items confirms it.1

Why it is asked: it is the standard method for "expected number of ..." puzzles. Read the full explanation: IIT Delhi chapter notes on linearity.

What is the coupon collector problem, and how many rolls does it take to see every face of a die?

Split the wait into stages: the wait for the i-th new face is geometric with mean n/(n − i + 1) (IIT Delhi chapter notes). For n = 6 the stages average 1, 1.2, 1.5, 2, 3 and 6 rolls, and by linearity the total is 14.7 rolls.1 In general it is n times (1 + 1/2 + ... + 1/n).

Why it is asked: it combines geometric waits with linearity in one question. Read the full explanation: IIT Delhi chapter notes, coupon collector setup.

What is the expected number of trials until the first success?

The number of trials until the first success with probability p is geometric with mean 1/p (IIT Delhi chapter notes). A fair coin takes 2 flips on average to show heads, and a fair die takes 6 rolls on average to show a six.1 The mean is a long-run average, so any single run can be much shorter or longer.

Why it is asked: it is the building block inside the coupon collector and many waiting-time puzzles. Read the full explanation: probability interview questions.

Knowing it is half the job. Saying it is the other half.

Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.

Start Free Trial →

What does not follow from expected value

Does E[X·Y] equal E[X] times E[Y]?

Not in general: E[X·Y] = E[X]E[Y] holds when X and Y are independent, and more generally exactly when they are uncorrelated (Cov(X, Y) = 0); linearity needs neither (University of Washington, Computer Science and Engineering (CSE) 312 slides). Take X = ±1 with probability one half each and Y = X. Then E[X·Y] = E[X²] = 1, but E[X] × E[Y] = 0 × 0 = 0.1 Y depends fully on X and Cov(X, Y) = 1, not 0, so the rule fails.

Why it is asked: it tests whether you know which rules need independence. Read the full explanation: CSE 312, linearity of expectation B.

Is E[f(X)] equal to f(E[X])?

No, not in general (University of Washington, CSE 312 slides). For a fair die and f(x) = x², E[X²] is 15.1667 while (E[X])² is 12.25.1 Averaging first and then squaring understates the average of the squares. Only a linear function lets you move the expectation inside.

Why it is asked: candidates often apply a nonlinear function to a mean and call it the expectation. Read the full explanation: CSE 312, linearity of expectation B.

Is the expected maximum equal to the maximum of the means?

No. Take independent standard normal variables, each with mean 0. The maximum of the means is 0, but the expected maximum is positive, because the largest of several draws tends to be above zero (Gwern, expected maximum). For two such variables it is 0.5642.1 Expectation of a maximum is a nonlinear operation.

Why it is asked: it tests whether you see that the maximum is not linear. Read the full explanation: Gwern, Calculating the Gaussian expected maximum.

The maximum of normal variables

What is the expected value of the maximum among N normally distributed random variables?

Gwern states that the expectation "has no exact formula" and is "generally not built into any programming language's libraries" (Gwern). For N independent standard normals, the maximum has cumulative distribution function Φ(x)^N, so E[max]=N∫xφ(x)Φ(x)N−1dx, an integral you evaluate numerically. For independent standard normals the exact values are 0.56 for N = 2, 1.16 for N = 5, 1.54 for N = 10 and 2.51 for N = 100.1 For mean μ and standard deviation σ, rescale: μ + σ times the standard value.

The simplest upper bound is σ times √(2 ln N), which makes the diminishing returns clear (Gwern). It gives 1.18 for N = 2 and 3.03 for N = 100, so the bound is higher than the exact value at every size shown.1

The sqrt(2 ln N) bound overshoots the true expected maximumGrouped bars for N independent standard normals: the exact expected maximum is 0.56, 1.16, 1.54 and 2.51 at N of 2, 5, 10 and 100, while the sqrt(2 ln N) bound gives 1.18, 1.79, 2.15 and 3.03.Expected maximum012342510100Number of normals NExact valueUpper bound sqrt(2 ln N)0.561.161.542.511.181.792.153.03Diagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/expected-value-interview-questions.html
The bound sigma times sqrt(2 ln N) is an upper bound, and it is loosest relative to the exact value for small N.CC BY 4.0 — source: Expected value interview questions: linearity, coupon collector, St. Petersburg
Text description of the diagram
  • The exact expected maximum of independent standard normals is 0.56 for N = 2, 1.16 for N = 5, 1.54 for N = 10 and 2.51 for N = 100.
  • The bound sqrt(2 ln N) gives 1.18 for N = 2 and 3.03 for N = 100, so the bound is higher than the exact value at every size shown.

Why it is asked: it tests whether you know when there is no closed form and still give a usable answer. Read the full explanation: DasGupta, Lahiri and Stoyanov, bounds for the Gaussian sample maximum.

How do you approximate the expected maximum of normals in practice?

Use a table of exact values or numerical integration, rescaled by the mean and standard deviation (Gwern). For a quick formula, Blom's approximation is μ+σΦ−1(n−αn−2α+1) with α = 0.375, and Elfving's correction uses α = π/8, meant for large n (Gwern). The leading-order growth is √(2 log n) (DasGupta, Lahiri and Stoyanov).

Why it is asked: it checks whether you can name a method and its limit, not recite a formula. Read the full explanation: Gwern, order statistics.

Expected value puzzles with Bayes and states

These expected value puzzles need one step before the arithmetic: update a probability with Bayes' theorem, or write an equation for the expected value from the state you are in.

One coin is fair and one is double-headed; you pick one at random and see heads. What is the expected number of heads on the next flip?

Update first, then weight. Heads has probability 1 for the double-headed coin and 1/2 for the fair coin, so by Bayes' theorem the posterior probability of the double-headed coin is (1/2 × 1) / (1/2 × 1 + 1/2 × 1/2) = 2/3. The next flip then gives 2/3 × 1 + 1/3 × 1/2 = 5/6 expected heads, about 0.8333.1 The tempting answer, 3/4, is the average before the update.

Why it is asked: it checks that you update before you take the expectation. Read the full explanation: Bayes theorem interview questions.

What is the expected number of flips of a fair coin until two heads appear in a row?

Condition on the first flip or two. Let E be the expected number of flips. Tails (probability 1/2) costs one flip and restarts, so 1 + E. Heads then tails (1/4) costs two flips and restarts, so 2 + E. Heads then heads (1/4) ends after 2 flips. So E = ½(1 + E) + ¼(2 + E) + ¼ × 2, which solves to E = 6.1

Why it is asked: it teaches the state-equation method that linearity alone does not cover. Read the full explanation: probability interview questions.

Paradoxes and decisions

What is the St. Petersburg paradox?

A fair coin is flipped until it lands heads, and the payoff doubles with each flip. A payoff of 2 has probability 1/2, a payoff of 4 has probability 1/4, and so on, so each possible outcome adds an expected payoff of 1 dollar. With infinitely many outcomes the expected value is an infinite number of dollars (Stanford Encyclopedia of Philosophy). Yet few people would pay much to play.

Why it is asked: it probes whether you separate expected value from a sensible price. Read the full explanation: Stanford Encyclopedia of Philosophy, St. Petersburg paradox.

Should you pay any price for a game with infinite expected value?

No: expected value is a long-run average, not a promise about a single play. Two standard resolutions are decreasing marginal utility, where the sum of expected utilities reaches a limit of about 0.602 utiles, worth 4 dollars, and a finite bankroll (Stanford Encyclopedia of Philosophy). If the game is truncated at k flips the expected payoff is k dollars, so 20 dollars for a cap of 20 flips,1 although that is a different game from the one described.

Why it is asked: it tests judgement about when to trust a mean. Read the full explanation: Stanford Encyclopedia of Philosophy, St. Petersburg paradox.

Follow-up questions

How do expected value and Bayes brainteasers fit together?

Many brainteasers first update a probability with Bayes' theorem and then take an expectation under the updated probabilities. Do it in that order: compute the posterior, then weight each outcome by it. The double-headed coin entry above is a worked case. Practise the update step on the Bayes theorem interview questions, then apply the weighting from this page.

What are the classic probability puzzles that use expected value?

The recurring ones are the die roll, the sum of dice, matching or fixed-point counts, the coupon collector, waiting for a first success, the maximum of several draws, the double-headed coin, the wait for two heads in a row and the St. Petersburg game, all answered above. For puzzles built on counting and conditioning, see the probability interview questions.

How do you check an expected value by simulation?

Simulate the experiment many times and average the results; the sample mean settles near the true expected value, for example near 3.5 for a die.1 The method is the same one used to estimate pi, covered in the Monte Carlo estimate of pi. It confirms a formula but does not replace deriving it.

Is expected value the same as the sample mean?

No. Expected value is a property of the distribution, while the sample mean is computed from observed data and estimates it. They are close for large samples. For when to report a mean or a median, see mean versus median.

Key takeaways
  • Expected value is a probability-weighted average; it need not be a possible outcome.
  • Linearity of expectation holds for any random variables, independent or not.
  • Count with indicator variables: add the probabilities of the events.
  • E[X·Y] = E[X]E[Y] holds for independent (more generally, uncorrelated) variables, and E[f(X)] = f(E[X]) fails in general.
  • The expected maximum of N normals has no closed form; use a table, numerical integration or the √(2 ln N) bound.
  • An infinite expected value does not mean you should pay anything to play once.

Sources

  1. Expected value of discrete random variables (Statistics LibreTexts, Saint Mary's College) — Statistics LibreTexts, 26 Oct 2026
  2. Expected value (StatLect) — StatLect, 1 Jan 2021
  3. 18.5 Linearity of Expectation, Mathematics for Computer Science (Lehman, Leighton, Meyer) — Engineering LibreTexts, 26 Oct 2026
  4. Linearity of Expectation (chapter notes, COL106) — IIT Delhi (archived copy of 4 December 2025), 26 Oct 2026
  5. Lecture 9, Linearity of Expectation B (CSE 312, spring 2022) — University of Washington, 26 Oct 2026
  6. Calculating The Gaussian Expected Maximum (Gwern Branwen) — gwern.net, 15 Oct 2022
  7. Sharp Fixed n Bounds and Asymptotic Expansions for the Mean and Median of a Gaussian Sample Maximum (DasGupta, Lahiri, Stoyanov) — Purdue University, 23 Jan 2014
  8. The St. Petersburg Paradox (Stanford Encyclopedia of Philosophy, 2008 archive) — Stanford Encyclopedia of Philosophy, 1 Jun 2008