Skip to content
Vamshi Jandhyala

Books · The Fiddler: Solutions

Chapter 30

The Randy Hall Problem

A game show has three doors in a row, 11, 22, 33. 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 22, a move goes to 11 or 33 with equal chance, and the host fixes a 2020 percent chance of staying at door 22. You want each door to be almost equally likely after many presses. What stay probability should the button give at door 11 (and door 33)?

The Fiddler, Zach Wissner-Gross, November 7, 2025(original post)

The three-door walk. Door 22 stays put with probability 0.20.2; doors 11 and 33 stay with probability pp, the value to be tuned.

Solution

Call the stay probability at doors 11 and 33 by pp. We want the long-run distribution to be uniform, 13\tfrac13 at each door. The only ways to arrive at door 22 are to stay there (probability 0.20.2) or to step in from door 11 or door 33 (each leaving with probability 1p1-p). Balance at door 22 with every door at 13\tfrac13, 13=13(1p)+13(1p)+13(0.2)    1=2(1p)+0.2,\tfrac13 = \tfrac13(1-p) + \tfrac13(1-p) + \tfrac13(0.2) \;\Longrightarrow\; 1 = 2(1-p) + 0.2, so 2(1p)=0.82(1-p)=0.8 and p=35.p = \boxed{\tfrac35}.

The computation

Build the transition matrix for p=0.6p=0.6 and read off its stationary distribution (the left eigenvector for eigenvalue 11). It is uniform, 13\tfrac13 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

Now door 22’s stay probability alternates: 2020 percent on the odd presses, 5050 percent on the even ones. What stay probability pp at doors 11 and 33 makes the doors equally likely in the long run?

Solution

The walk now has period two, so its distribution oscillates; we ask that the time-average be uniform. Writing the door-22 probability after an odd and an even press in terms of pp and averaging, the uniform condition π2=13\overline{\pi_2}=\tfrac13 reduces to a quadratic, 40p213p9=0,p=13+1609800.664.40p^2 - 13p - 9 = 0,\qquad p = \frac{13+\sqrt{1609}}{80} \approx \boxed{0.664}. The alternating stickiness at door 22 pushes the required stay probability up from 0.60.6 to about 0.6640.664. (The source’s value is behind its paywall; this is my own.)

The computation

Compose the two alternating press-matrices into one two-step cycle, take its stationary distribution, average over the odd and even half-steps, and solve for the pp that levels doors 11 and 22.

from scipy.optimize import brentq
def avg_pi(p):
    Mo = np.array([[p, 1-p, 0], [0.4, 0.2, 0.4], [0, 1-p, p]])     # odd press
    Me = np.array([[p, 1-p, 0], [0.25, 0.5, 0.25], [0, 1-p, p]])   # even press
    w, v = np.linalg.eig((Mo@Me).T); po = np.real(v[:, np.argmin(abs(w-1))]); po /= po.sum()
    return (po + po@Mo)/2
p = brentq(lambda p: avg_pi(p)[0] - avg_pi(p)[1], 0.4, 0.9)
print(round(p, 5), (13 + np.sqrt(1609))/80)                  # 0.66390  0.66390