Qm

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 0.40.4 (and stays stocked with probability 0.60.6).
  • If empty today, it becomes stocked tomorrow with probability 0.80.8 (and stays empty with probability 0.20.2).

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

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. 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 →