Library · The Fiddler: Solutions · Chapter 50
The Randy Hall Problem
A game show has three doors in a row, , , . A contestant starts at one door and presses a button many times; each press either keeps them put or moves them to an adjacent door. From door , a move goes to or with equal chance, and the host fixes a percent chance of staying at door . You want each door to be almost equally likely after many presses. What stay probability should the button give at door (and door )?
The Fiddler, Zach Wissner-Gross, November 7, 2025(original post)
Solution
Call the stay probability at doors and by . We want the long-run distribution to be uniform, at each door. The only ways to arrive at door are to stay there (probability ) or to step in from door or door (each leaving with probability ). Balance at door with every door at , so and
The computation
Build the transition matrix for and read off its stationary distribution (the left eigenvector for eigenvalue ). It is uniform, at every door.
import numpy as np
p = 0.6
M = np.array([[p, 1-p, 0], [0.4, 0.2, 0.4], [0, 1-p, p]]) # rows sum to 1
w, v = np.linalg.eig(M.T); s = np.real(v[:, np.argmin(abs(w-1))])
print(np.round(s/s.sum(), 4)) # [0.3333 0.3333 0.3333]
Extra Credit
Moving from door still takes a contestant to door or door with equal chance. But on odd-numbered presses (the first, third, fifth and so on) there is a percent chance of staying at door , and on even-numbered presses a percent chance. The behaviour at doors and does not depend on the press number. You want the three doors to be nearly equally likely after a large even number of presses. What should the stay probability at door (and door ) be?
Solution
The rule now changes from press to press, so a single press has no steady state. A pair of presses does, though: an odd press followed by an even press is always the same random step. After a large even number of presses, the contestant has taken many of these double steps. The double step can reach every door and can stay put, so its distribution settles to one long-run distribution from any starting door. We want that distribution to be uniform, at each door.
So start from at each door, apply one odd press and then one even press, and ask for at each door again. Call the stay probability at doors and by .
After the odd press. Door keeps a share of its own and receives of door ’s (half of the percent that leaves door ). So it holds , and door holds the same. Door keeps of its share and receives from each side, so it holds .
After the even press. Door now keeps half its share and again receives from each side. Setting the result equal to and multiplying by : Expanding gives , or . Doors and are mirror images, so once door holds the other two share the rest equally, and all three are level. The positive root is
The word “even” matters. With this , after a large odd number of presses the doors are not level: the last press was a slippery percent one, and door holds only about percent while doors and hold about percent each. The extra stickiness at door on even presses is what lets door catch up, and it requires doors and to be stickier too, against in the main puzzle.
The computation
The check does not use the double-step equation. It runs the actual alternating process: starting with the contestant at door , it applies presses in order, each with the stay chance at door that its press number dictates, and then searches for the that leaves door with exactly . It also shows the distribution after an odd number of presses, and from a different starting door.
import numpy as np
from scipy.optimize import brentq
def press(p, stay2):
return np.array([[p, 1-p, 0], [(1-stay2)/2, stay2, (1-stay2)/2], [0, 1-p, p]])
def after_presses(p, n=2000, start=0):
dist = np.zeros(3); dist[start] = 1
for k in range(1, n + 1): # press number k
dist = dist @ press(p, 0.2 if k % 2 else 0.5)
return dist
p = brentq(lambda p: after_presses(p)[1] - 1/3, 0.5, 0.95, xtol=1e-14)
print("p = %.10f" % p)
print("after 2000 presses:", np.round(after_presses(p), 6))
print("after 2001 presses:", np.round(after_presses(p, 2001), 6))
print("starting at door 2:", np.round(after_presses(p, 2000, start=1), 6))
It prints
p = 0.7226812024
after 2000 presses: [0.333333 0.333333 0.333333]
after 2001 presses: [0.374227 0.251546 0.374227]
starting at door 2: [0.333333 0.333333 0.333333]
The value of matches to the ten places shown.