Drw · Probability & Brainteasers
Expected Rounds Until a Shopping-Cart Line Empties Under Random Transfers
TrueInterview
October 7, 2026 · 1 min read
At the start, one line holds 6 shopping carts and the other holds 7. Each round picks one of the two lines with equal probability and removes a cart from that line; the cart is then placed into a line chosen independently and with equal probability, so it can return to the same line. The process stops at the end of a round if either line has no carts left.
Find the expected number of rounds.
Find the single number that matters
The total number of carts is constant. Represent the state by one count, determine how that count can change in a single round, and write equations for the expected number of rounds left.
Constraints and Clarifications
- At the beginning of any round that is actually played, both lines still contain carts, so the chosen line always has a cart to remove.
- A round where the cart goes back to the line it came from still counts as one round.
- Provide an exact answer.
What a Strong Answer Covers
- Modeling the two-line system as a one-dimensional process with absorbing endpoints.
- Correct single-round transition probabilities, including rounds in which the counts do not change.
- Solving the expected hitting-time recurrence together with its boundary conditions.
- A sanity check, for instance comparing against a walk whose counts change every round.
Follow-up Questions
- What is the probability that the line initially holding 6 carts is the first to become empty?
- How would the expected number of rounds change if the removed cart were always placed in the other line?
- Generalize the result to starting counts of and carts.
Overview: A Markov chain expectation problem where two lines begin with 6 and 7 shopping carts, and each round moves one cart from a uniformly selected line to a uniformly selected line, possibly the same line. It asks for the expected number of rounds until one line empties, testing random-walk modeling and hitting-time recurrences.