How many random numbers until the total passes one?
Press a button and a number appears, uniformly random between 0 and 1. Press again and another appears, independent of the first. Keep pressing until the running total exceeds 1.
- What is the probability that you need more than n presses?
- What is the expected number of presses?
Show a hint
"More than n presses" means the first n numbers add up to at most 1. The set of n numbers in the unit cube whose sum is at most 1 is a pyramid-like corner; find its volume. Then recall that the expected value of a counting variable is the sum of the probabilities of exceeding each n.
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
Sign in to join the discussion · reading is open to everyone
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.
Related questions
The expected length of the shorter pieceThe country where every family wants a boyRelabel one die so that every total is equally likelyThe expected length of the middle pieceWaiting for heads-tails versus heads-heads
All questions →