Skip to content
  • Overview
  • Curriculum
    • FLUMental maths and numerical fluency
    • COMBCounting and combinatorics
    • PROBProbability
      • 1Conditioning and Bayes

        • Conditional probability and Bayes
      • 2Distributions

        • The distributions you have to know cold
      • 3Expectation, variance and the big tricks

        • Linearity of expectation
        • Conditioning: the tower property
        • Recursive expected value and the re-roll family
      • 4Random walks and Markov chains

        • Random walks and gambler’s ruin
        • Markov chains: states, transitions and hitting times
      • 5Order statistics and extremes

        • Order statistics: maxima, minima and the gaps between
      • 6Simulation and Monte Carlo

        • Simulation: making randomness you want out of randomness you have
    • GAMEGames, decision theory and puzzles
    • MMMarket making
    • MKTMarkets and products

Practise

  • Question bank
  • Mental arithmetic
  • Market simulator
  • Arbitrage trees
  • Horse racing
  • Bid book
  • Screening tests
  • Mock papers

Reference

  • Formula reference
  • Search

Your record

  • Review queue
  • Progress
  • Leaderboard
  • Profile
  • Invite friends
AccountSend feedback
  1. Curriculum
  2. /Trading and market making
  3. /Probability
  4. /Expectation, variance and the big tricks

Linearity of expectation

PROB · Chapter 3·9 min read·Asked at Jane Street, Optiver, SIG, Five Rings

After this lesson you should be able to

  • State linearity of expectation and explain why independence is not required.
  • Decompose a complicated count into a sum of indicator variables.
  • Use the method on problems where writing the distribution down is hopeless.

The expectation of a sum is the sum of the expectations — always, whether or not the terms are independent. Almost every hard counting-flavoured probability question in a quant interview becomes easy the moment you write the quantity as a sum of indicators and apply this.

Equation 3.1

The statement

For any random variables X1,…,XnX_1,\dots,X_nX1​,…,Xn​ on the same probability space, and any constants aia_iai​:

E ⁣[∑i=1nXi]=∑i=1nE[Xi]\mathbb{E}\!\left[\sum_{i=1}^{n} X_i\right] = \sum_{i=1}^{n} \mathbb{E}[X_i]E[i=1∑n​Xi​]=i=1∑n​E[Xi​]
XiX_iXi​
Any random variable. No independence assumption.
E[Xi]\mathbb{E}[X_i]E[Xi​]
The expectation of the iii-th term, computed on its own.

Equation 3.2

With constants

E ⁣[∑iaiXi+b]=∑iai E[Xi]+b\mathbb{E}\!\left[\sum_i a_i X_i + b\right] = \sum_i a_i\,\mathbb{E}[X_i] + bE[i∑​ai​Xi​+b]=i∑​ai​E[Xi​]+b

Why independence is irrelevant here. Expectation is an integral, and integration is linear. E[X+Y]\mathbb{E}[X+Y]E[X+Y] sums x+yx+yx+y over the joint distribution; splitting that sum into an xxx part and a yyy part only needs each marginal, never how they move together. Dependence changes *where the mass sits jointly*, not the marginal averages. This is exactly why variance behaves differently: Var⁡(X+Y)\operatorname{Var}(X+Y)Var(X+Y) carries a covariance term, because squaring mixes the two variables together.

IdentityNeeds independence?
E[X+Y]=E[X]+E[Y]\mathbb{E}[X+Y] = \mathbb{E}[X] + \mathbb{E}[Y]E[X+Y]=E[X]+E[Y]No — always true
E[XY]=E[X] E[Y]\mathbb{E}[XY] = \mathbb{E}[X]\,\mathbb{E}[Y]E[XY]=E[X]E[Y]Yes (uncorrelated suffices)
Var⁡(X+Y)=Var⁡(X)+Var⁡(Y)\operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y)Var(X+Y)=Var(X)+Var(Y)Yes (uncorrelated suffices)
E[g(X)]=g(E[X])\mathbb{E}[g(X)] = g(\mathbb{E}[X])E[g(X)]=g(E[X])Never true in general — see Jensen
Table 3.3 · What does and does not need independence.

Proposition 3.4

The indicator method

To find the expected number of things with some property, define Ik=1I_k = 1Ik​=1 when the kkk-th thing has the property and 000 otherwise. Then the count is N=∑kIkN = \sum_k I_kN=∑k​Ik​, and because E[Ik]=Pr⁡(Ak)\mathbb{E}[I_k] = \Pr(A_k)E[Ik​]=Pr(Ak​) where AkA_kAk​ is the event that item kkk has the property, you get E[N]=∑kPr⁡(Ak)\mathbb{E}[N] = \sum_k \Pr(A_k)E[N]=∑k​Pr(Ak​). You never need the distribution of NNN.

Holds when

  • The property must be checkable for each item separately.
  • The items may overlap, interact or be strongly dependent — it does not matter.

Derivation 3.5

Why an indicator’s expectation is a probability

  1. Ik={1if the event Ak occurs0otherwiseI_k = \begin{cases} 1 & \text{if the event } A_k \text{ occurs} \\ 0 & \text{otherwise} \end{cases}Ik​={10​if the event Ak​ occursotherwise​
  2. E[Ik]=1⋅Pr⁡(Ak)+0⋅Pr⁡(Akc)\mathbb{E}[I_k] = 1\cdot\Pr(A_k) + 0\cdot\Pr(A_k^{c})E[Ik​]=1⋅Pr(Ak​)+0⋅Pr(Akc​)

    Expectation of a two-valued variable, straight from the definition.

E[Ik]=Pr⁡(Ak)\mathbb{E}[I_k] = \Pr(A_k)E[Ik​]=Pr(Ak​)

Example 3.6

The tournament question

A single-elimination tournament starts with nnn equally skilled teams. Each round pairs the surviving teams at random, with a random bye when the count is odd. Two particular teams, A and B, are in the draw. What is the probability they play each other at some point? (Five Rings.)

Show the worked solutionHide the worked solution

Worked solution

  1. Formula
    Pr⁡(A plays B)=E[#games between A and B]=∑gPr⁡(game g is A vs B)\Pr(\text{A plays B}) = \mathbb{E}[\#\text{games between A and B}] = \sum_{g} \Pr(\text{game } g \text{ is A vs B})Pr(A plays B)=E[#games between A and B]=g∑​Pr(game g is A vs B)
  2. Substitute
    =(n−1)×(n2)−1= (n-1) \times \binom{n}{2}^{-1}=(n−1)×(2n​)−1
  3. Solve
    A and B can meet at most once, so #games∈{0,1}\text{A and B can meet at most once, so } \#\text{games} \in \{0,1\}A and B can meet at most once, so #games∈{0,1}
    An indicator. Its expectation is therefore exactly the probability we want.
  4. A tournament with n teams plays exactly n−1 games\text{A tournament with } n \text{ teams plays exactly } n-1 \text{ games}A tournament with n teams plays exactly n−1 games
    Every game eliminates exactly one team, and all but the winner are eliminated.
  5. Pr⁡(a given game is A vs B)=(n2)−1=2n(n−1)\Pr(\text{a given game is A vs B}) = \binom{n}{2}^{-1} = \frac{2}{n(n-1)}Pr(a given game is A vs B)=(2n​)−1=n(n−1)2​
    By symmetry every unordered pair is equally likely to be the one playing.
  6. Pr⁡=(n−1)⋅2n(n−1)\Pr = (n-1)\cdot\frac{2}{n(n-1)}Pr=(n−1)⋅n(n−1)2​
  7. Answer
    Pr⁡(A plays B)=2n\Pr(\text{A plays B}) = \frac{2}{n}Pr(A plays B)=n2​

Sanity check. With n=2n = 2n=2 the answer is 111: they must play. With n=8n = 8n=8 it is 1/41/41/4, matching the casework answer of 2/82/82/8.

The rest of this lesson is in Premium

You have read the opening. 11 more sections follow, including 5 worked examples and 3 quick checks.

Start the free 7-day trialSign in

Nothing is charged for 7 days, and you can cancel before then. Or read Arithmetic that survives a clock in full, free.

← The distributions you have to know coldConditioning: the tower property →
On this page
  • The statement
  • With constants
  • What does and does not need independence
  • The indicator method
  • Why an indicator’s expectation is a probability
  • Worked example — the tournament question

QuantMax · 141 lessons · 1342 questions · c5c0caa

  • Premium
  • Arbitrage trees
  • Horse racing
  • Invite friends
  • Account
  • About QuantMax
  • Terms
  • Privacy

Firm names identify publicly reported question patterns and nothing more. QuantMax is not affiliated with, endorsed by, or recruiting for any firm named in the curriculum. Everything you do in lessons and the question bank is kept to your account.