Quick puzzle: how long to get to heaven?
For today, just a fun brain teaser that was passed along to me.
A person dies and arrives at the gates to heaven. There are three identical doors: one of them leads to heaven, another leads to a 1-day stay in limbo, and then back to the gate, and the other leads to a 2-day stay in limbo, and then back to the gate.
Every time the person is back at the gate, the three doors are reshuffled. How long, on the average, will it take the person to reach heaven?
There’s a quick way to solve this puzzle. Can you figure it out?
Hint: see method 3 of the dice brain teaser
I am going to narrate how I arrived at the answer. But if you just want the answer, skip ahead to the section labeled The answer.
A first attempt: the direct sum
I initially attempted the problem as a straight expectation: I would weight the number of days by its associated probability.
In other words, if pn is the probability of taking n days, then the average number of days would be:
N = 0 * p0 + p1 + 2p2 + 3p3 + 4p4 + 5p5…
The question is: how to calculate pn?
The first few cases are simple enough. There is only one way to make it in zero days–namely pick the right door on the first try–and so p0 is 1/3 (there are three doors, each equally likely to be picked).
To make it in one day again there is only one way–pick the door holding you for a day, and then pick the door going to heaven–and so that means p1 is 1/3 * 1/3 = 1/9.
Continuing, we can calculate the probability for taking two days. For this case, there are two different routes one could take. One route is to take the door holding for two days and then pick the door going to heaven (1/3 * 1/3), and the other route is to pick the door holding for one day twice and then pick the door to heaven (1/3 * 1/3 * 1/3). This means p2 = (1/3 * 1/3) + (1/3 * 1/3 * 1/3).
Note that the expression is not simplified. The reason is to demonstrate a pattern in the probability, namely that:
p2 = 1/3 * (p0 + p1)
Why should that be? The recursion happens because of the following observation. To take two days to reach heaven, you can either add two days to the case of taking zero days, or you can add one day to the case of taking one day. The coefficient of 1/3 is because adding that extra door in the route happens with probability 1/3.
This logic also applies to cases taking 3 or more days to get to heaven. So, for example, we can say that:
p3 = 1/3 * (p1 + p2)
The reason is that there are two possible ways to take three days to get to heaven. One can either add two days to a route taking a single day, or one could add a single day to a route taking two days.
The recursion formula applies generally, and we get the following formula:
pn + 2 = 1/3 * (pn + 1 + pn)
Recursive formulas like this are extremely useful as they can be programmed into spreadsheets readily. Once the probabilities for 0 and 1 days are inputted, the recursive formula can be used to determined each subsequent one.
With this method, I decided to sum up the partial sum up to 25 terms. From the third term and onwards, the calculation was based on the recursive formula.
Here is the result:
| N | P(N) | N * P(N) |
| 0 | 0.333 | 0.000 |
| 1 | 0.111 | 0.111 |
| 2 | 0.148 | 0.296 |
| 3 | 0.086 | 0.259 |
| 4 | 0.078 | 0.313 |
| 5 | 0.055 | 0.274 |
| 6 | 0.044 | 0.266 |
| 7 | 0.033 | 0.232 |
| 8 | 0.026 | 0.206 |
| 9 | 0.020 | 0.177 |
| 10 | 0.015 | 0.151 |
| 11 | 0.012 | 0.128 |
| 12 | 0.009 | 0.107 |
| 13 | 0.007 | 0.089 |
| 14 | 0.005 | 0.073 |
| 15 | 0.004 | 0.060 |
| 16 | 0.003 | 0.049 |
| 17 | 0.002 | 0.040 |
| 18 | 0.002 | 0.033 |
| 19 | 0.001 | 0.027 |
| 20 | 0.001 | 0.021 |
| 21 | 0.001 | 0.017 |
| 22 | 0.001 | 0.014 |
| 23 | 0.000 | 0.011 |
| 24 | 0.000 | 0.009 |
| 25 | 0.000 | 0.007 |
| sum | 2.97 |
This is an interesting result–the series evidently converges to 3.
Can this sum be proved to converge to 3?
I bet it can, but I have not yet worked it out–bonus points to anyone who comes up with the proof.
It was while working on this that I realized that this approach was inefficient and not the easiest one.
It turns out there is an elegant and simple way to find the answer.
The answer
Let N denote the average number of days it takes to get to heaven.
The trick to solve for N is to rewrite the average using symmetry of the game.
N is equal to the average number of days regardless of which door you enter first. This splits up into three cases:
Case 1: One-third of the time you go directly to heaven, and that’s 0 days.
Case 2: One-third of the time you pick the door that adds 1 day. In this case, you end up in heaven in N + 1 days.
Case 3: The remaining one-third you pick the door that adds 2 days. In this case, you end up in heaven in N + 2 days.
These observations lead to the following equation and answer:
N = 1/3 * 0 + 1/3 * (N + 1) + 1/3 * (N + 2)
N = 1/3 *N + 1/3 + 1/3 *N + 2/3
N = 2/3 *N + 1
1/3 * N = 1
N = 3
This approach is much easier! And the answer is therefore that it will take 3 days to reach heaven.
Share this post:
Previous post: The Mind Your Decisions forum is up
Next post: Gifts for economists, 2010



