I came across a puzzle over the internet(https://www.interviewbit.com/problems/gates-of-heaven/).

Amanda dies and reaches at the gate of heaven.

She has three doors in front of her out of which only one of them leads to heaven.

Out of the other two gates, one leads to hell for one day and then back to the gate and one leads to hell for two days and then back to the gate.

If she chooses one of these two gates, the gates are shuffled when she returns back.

How long is Amanda expected to take to reach heaven?

Surprisingly its answer is 3 days. There are certain verbal solutions over the internet but I couldn't reach its mathematical proof. Can anyone help?


Let the average time to reach heaven be $t$ days. The probability of choosing each door is 1/3. If she chooses the second door, she spends 1 day in hell, after which on average she would again need on average $t$ days to reach heaven. Similarly for the third door. Thus, we can write an equation $$ t=\frac{1}{3}(t+1) + \frac{1}{3}(t+2) $$ and find $t=3$.