Chapter 6
Will The Neurotic Basketball Player Make His Next Free Throw?
A basketball player is in the gym practicing free throws. He makes his first shot, then misses his second. This player tends to get inside his own head a little bit, so this isn’t good news. Specifically, the probability he hits any subsequent shot is equal to the overall percentage of shots that he’s made thus far. (His neuroses are very exacting.) His coach, who knows his psychological tendency and saw the first two shots, leaves the gym and doesn’t see the next 96 shots. The coach returns, and sees the player make shot No. 99. What is the probability, from the coach’s point of view, that he makes shot No. 100?
The Riddler, FiveThirtyEight(original post)
Solution
After the opening make and miss the player holds a tally of made and missed shot, and each new shot is a make with probability equal to the current fraction of makes, after which the tally of that outcome grows by one. This is precisely Pólya’s urn: an urn holding one “make” token and one “miss” token, from which we draw at random, note the colour, and return that token together with a fresh one of the same colour.
Two facts about this urn settle the problem.
The shots are exchangeable. Take any particular sequence of the shots from the third onward with makes among its first entries. Multiplying the draw probabilities along the sequence, the makes contribute the rising factors to the numerators and the misses contribute , while the denominators run regardless of order. So which depends only on the count , not on the order. The shots can be reshuffled freely without changing any probability.
Each shot is an even-money make. The same expression equals , so the shots behave exactly as if a hidden make-rate were drawn uniformly on and every shot were then an independent make with probability . In particular each individual shot is a make with probability .
The coach saw shot land and asks for shot . By exchangeability the unwatched shots carry no information, and
The computation
Simulate the neurotic shooter as described: start from one make and one miss, take shots through with each make probability equal to the running fraction of makes, keep only the runs in which shot is a make, and among those measure how often shot is also a make.
import numpy as np
rng = np.random.default_rng(0)
runs = 2_000_000
seen99 = made100 = 0
for _ in range(runs):
hits, throws = 1, 2 # one make, one miss to start
for shot in range(3, 101):
make = rng.random() < hits / throws # P(make) = make fraction
hits += make; throws += 1
if shot == 99 and not make: # coach saw 99 land; drop misses
break
if shot == 99:
seen99 += 1
if shot == 100:
made100 += make
print(made100 / seen99) # ~0.6667