Chapter 48
How Close To The Bullseye Can Robin Get?
Robin always hits the circular target, uniformly at random over its area. She fires arrows as long as each lands closer to the center than the one before; her score is the number of arrows fired, including the first one that breaks the streak. On average, what score can she expect? Extra credit: with ten concentric circles of radii , she instead needs each arrow inside a smaller circle than the last. Now what is her expected score?
The Riddler, FiveThirtyEight(original post)
Solution
The plain target. Only the order of the arrows’ distances matters, and those distances are independent and continuous, so every order is equally likely. The streak survives through arrows exactly when their distances are strictly decreasing, which happens with probability (one decreasing order out of ). The score exceeds with that probability, so
The ringed target. Now an arrow counts by which ring it lands in: ring (between radii and ) has area fraction . A streak of arrows means distinct rings hit in strictly decreasing order, one order per choice of rings, so is the elementary symmetric sum . Summing all of them telescopes into a product: Coarser rings make ties common, which cuts the streak shorter than the sharp-distance value .
The computation
Fire the arrows: for the plain target compare exact distances; for the ringed target compare ring indices (ring for a uniform area fraction ). Average the streak length, and evaluate the product.
import numpy as np
from math import prod, ceil, sqrt
rng = np.random.default_rng(0)
def expected(ringed, runs=2_000_000):
total = 0
for _ in range(runs):
prev = ceil(10*sqrt(rng.random())) if ringed else rng.random()
score = 1
while True:
cur = ceil(10*sqrt(rng.random())) if ringed else rng.random()
score += 1
if cur < prev: prev = cur
else: break
total += score
return total / runs
print(expected(False)) # ~2.718 = e
print(expected(True)) # ~2.56
print(prod(1 + (2*i - 1)/100 for i in range(1, 11))) # 2.5585...