Chapter 148
Carpool Tickets
The Riddler for May 19, 2017. The Express is a beautiful application of linearity of expectation: four drivers with per-drive ticket rates , , , each accumulate tickets before losing their licenses, and the total number of trips until the carpool dies is the simple sum trips, or days. The Classic, Battle for Riddler Nation Round , is a Colonel Blotto castle royale whose “answer” is the empirical tournament winner of reader-submitted plans; we defer it for the same reason we deferred its February predecessor.
Riddler Express
Four co-workers carpool to work each day. Each morning, one is selected uniformly at random to drive to work; each evening, one is selected uniformly at random to drive home. Each driver has a chance of being ticketed for speeding on a given trip. Driver ’s chance is , Driver ’s is , Driver ’s is , Driver ’s is . The state revokes a driver’s license immediately upon her third ticket, and that driver stops driving in the carpool. At most one ticket is issued per morning and at most one per evening (the lone officer on the route). Starting from no tickets, how many days do we expect the carpool to last until every driver has lost her license?
The Riddler, FiveThirtyEight, May 19, 2017(original post)
Solution
The neat trick is to count driver trips, not days. The randomisation rule says which active driver gets each trip, but the eventual loss of every license is fated to take a specific (random) number of trips per driver. By linearity of expectation, the total number of trips is the sum across drivers.
Trips per driver. A driver with ticket probability per trip needs tickets to lose her license. Counted in trips behind the wheel, this is the sum of three independent geometric random variables, one per ticket: trips between tickets are Geometric() with mean . So the expected number of trips a driver takes from her first drive to her license being revoked is Why linearity bypasses the scheduling. The total trips of the carpool is the sum, over drivers, of trips each one personally takes. Whether a driver’s trips are clumped early or scattered with idle weeks in between is determined by the random scheduling, but the count of her own trips until her third ticket is independent of how trips are allocated to others. Sum the individual expectations: Each day comprises two trips (morning and evening), so
A subtle point: the expectation per driver does not require independence from the scheduling, only the geometric distribution of trips-between-tickets for a given driver. The scheduling rule (uniform over active drivers, two trips per day) affects when each trip happens, but each driver’s own trip-count to license revocation is a fixed-mean variable, and totals add.
The computation
Encode the rule itself: simulate days of randomly assigned trips, accumulate tickets, retire drivers at , and stop when the active list is empty. Confirm the empirical expected days matches .
import random
P = [0.10, 0.15, 0.20, 0.25] # A, B, C, D
def run_carpool(rng):
tickets = [0] * 4
trips = 0
while True:
active = [i for i, t in enumerate(tickets) if t < 3]
if not active: return trips
i = rng.choice(active)
if rng.random() < P[i]:
tickets[i] += 1
trips += 1
rng = random.Random(0)
TRIALS = 500_000
total_trips = sum(run_carpool(rng) for _ in range(TRIALS))
avg_trips = total_trips / TRIALS
print(f"empirical trips = {avg_trips:.3f}, days = {avg_trips/2:.3f}")
# empirical trips = 77.051, days = 38.525
The simulation converges to trips on average, equivalently days, agreeing with the linearity calculation to three significant figures.
Riddler Classic
Battle for Riddler Nation, Round 2. In a distant war-torn land, there are castles worth victory points. You and your archenemy each have soldiers to distribute among the castles. Whoever sends more soldiers to a castle conquers it and wins its points; ties split. Submit a distribution of soldiers across castles. The tournament awards the crown to whichever submission wins the most one-on-one matchups against all other reader submissions.
The Riddler, FiveThirtyEight, May 19, 2017(original post)
Deferred (participatory contest)
The Classic is a Colonel Blotto castle royale whose “answer” has no closed form: the winner is the strategy that, in the actual tournament of reader-submitted plans, wins the most one-on-one matchups. There is no Nash equilibrium for a player to box; the game is multiplayer in spirit, and the question explicitly invites empirical adaptation to the publicly released earlier-round submissions on GitHub.
We defer this puzzle for the same reason as the February Round : it is a participatory empirical contest, not a problem with a derivable answer. Boxing an arbitrary distribution (e.g., the centroid of the previous round’s submissions, or an iterated best-response under some assumed prior) would dress one heuristic as the answer. The official write-up reports the actual tournament winner; this is not a quantity that can be rederived from the puzzle statement alone.
This is the fourth deferral in the build, after the -- gerrymander Express+Classic, the -- map-colouring game, and the -- Round Riddler Nation. All four sit in the same category: questions whose “answer” is empirical/participatory rather than derivable.