Problem #36 EASY
The Crowded Elevator
Amazon Adobe Probability Combinatorics
Problem Statement
A 10-story building has an elevator. Seven people enter the elevator on the ground floor, each traveling to one of the upper 9 floors chosen independently and uniformly at random. What is the expected number of stops the elevator makes? What if there are n people and f floors?
Answer & Quick Explanation
Think you've got it? Click below to check your answer.
Expected stops ≈ 5.06 for 7 people and 9 floors. General formula: E[stops] = f x (1 − ((f−1)/f)^n) where f is the number of destination floors and n is the number of passengers.
Detailed Editorial Solution
Want to see the step-by-step breakdown? Click below to reveal the editorial.
Use the indicator variable technique. Let Xi = 1 if at least one person exits on floor i, 0 otherwise. E[total stops] = sum of E[Xi] for i = 1 to 9, by linearity of expectation.
Step 1: There are 9 destination floors (floors 2 through 10). Each person independently picks one of the 9 floors uniformly at random.
Step 2: P(a specific person does NOT stop at floor i) = 8/9.
Step 3: P(no one stops at floor i) = (8/9)^7, since all 7 people independently avoid floor i.
Step 4: P(at least one person stops at floor i) = 1 − (8/9)^7.
Step 5: Compute: (8/9)^7 = (0.8889)^7 ≈ 0.4382. So P(stop at floor i) ≈ 1 − 0.4382 = 0.5618.
Step 6: Expected total stops = 9 x 0.5618 ≈ 5.06 stops. General formula for n people and f floors: E[stops] = f x (1 − ((f−1)/f)^n).
Key Insight:
Linearity of expectation is the key tool — it lets you decompose a complex joint probability into independent per-floor calculations. Each floor's contribution is independent of others, so summing E[Xi] gives the exact expected total without any painful combinatorics.