How long until the machine restocks?
A vending machine is either stocked or empty at the end of each day, and tomorrow depends only on today:
- If stocked today, it becomes empty tomorrow with probability (and stays stocked with probability ).
- If empty today, it becomes stocked tomorrow with probability (and stays empty with probability ).
The machine is stocked today.
On average, how many days until it is stocked again (its expected return time to the stocked state)?
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
Gas molecules shuffling between two chambersHow long until the server is back up?How long between green days?How long between charging sessions?How long until the inbox is empty again?
All questions →