Expected number of coin flips until the first head
Asked at Jane Street, Optiver, SIG
You flip a fair coin repeatedly until it lands heads for the first time.
What is the expected number of flips?
Follow-up: what if the coin is biased and lands heads with probability ?
Show a hint
Let be the answer. Condition on the outcome of the very first flip: what happens if it's a head, and what happens if it's a tail?