Linearity always holds
For any random variables and and constants ,
This requires no independence. It is the single most useful fact in interview probability, because it lets you break a hard count into easy pieces.
Indicator variables
To compute the expected number of times something happens, write the count as a sum of indicators , one per opportunity. Then
You never need the joint distribution of the — only each marginal probability.
Worked example
runs in coin flips
You flip a fair coin 10 times. What is the expected number of runs (maximal blocks of identical outcomes)? For example HHTHHH has 3 runs.
Show solutionHide solution
The first flip always starts a run. Each later flip starts a new run exactly when it differs from flip , which has probability . So
Knowledge check
You roll 12 fair dice. What is the expected number of distinct faces that appear?
First-step analysis
For waiting times and games, define the expected remaining value from each state and condition on the next step. This gives a linear system:
The trick is choosing states that capture exactly what matters for the future. For coin patterns, the state is "how much of the pattern is currently matched".
Worked example
expected flips until the first head
A coin lands heads with probability . How many flips until the first head, on average?
Show solutionHide solution
Let be the expected number of flips. The first flip is a head with probability (done after 1 flip), otherwise we are back where we started having used one flip:
Knowledge check
A fair die is rolled until a 6 appears. What is the expected number of rolls?
Practice problems
Finished reading?
Answer the 2 knowledge checks to complete this lesson (0 done).