Skip to content
QuantReadySign In
#010easyProbability

Expected Flips Until First Heads

Problem

You have a fair coin that lands heads with probability p = 0.5 on each flip. Flips are independent.

Compute the expected number of flips until you observe the first heads.

This is the expectation of a geometric distribution, one of the most fundamental results in probability and a common warm-up in quant interviews.

Enter your answer as a decimal rounded to 4 decimal places.

Constraints

  • 0 < p ≤ 1 (probability of heads)
  • Output rounded to 4 decimal places
Loading interactive editor…