Chapter 207
Alice And Bob Fall In Love
Riddler Express
Alice and Bob run a constant-speed footrace from the start out to a turning point and back, finishing where they started. Alice runs faster than Bob. After Alice U-turns at the far end, she sees Bob coming the other way and they run face-to-face until they pass each other. How much faster than Bob should Alice run to maximise the time she spends running face-to-face with him?
The Riddler, FiveThirtyEight, November 30, 2018(original post)
Solution
Let be the half-distance from start to turn-around, the two speeds, and the ratio we want to choose. Alice turns at time ; Bob turns at . Alice is faster, so she turns first.
Window of facing. Alice and Bob face each other from the moment Alice U-turns until they pass. After Alice’s turn, Alice’s position from start at time is (running back), and Bob’s is (still going out). They pass when , that is, Bob’s turn at comes later than this pass time: iff iff , which holds. So they pass before Bob turns. The facing time is
Maximising in . Hold fixed and write . Then The scale factor is fixed, so we maximise Differentiate: Setting the numerator to zero, , so At the optimum,
The computation
Verify the optimum numerically by scanning on a fine grid and confirming the maximum at .
import numpy as np
def t_face(r):
return (r - 1) / (r * (r + 1))
grid = np.linspace(1.001, 5.0, 100_000)
f = t_face(grid)
i = int(np.argmax(f))
print(f"empirical r* = {grid[i]:.4f}, "
f"theoretical r* = {1 + np.sqrt(2):.4f}")
print(f"empirical max = {f[i]:.6f}, "
f"theoretical = {3 - 2 * np.sqrt(2):.6f}")
The script prints and , matching the boxed answer.
Riddler Classic
Alice and Bob have their first child at time . The work a child requires their parents equals , where is the child’s age in years. They have the next child the moment the total work required across all their existing children drops to . So they have their second child at , their third at , and so on. Does it make sense for them to have infinitely many children? Does the time between kids grow as grows? What can you say about the time of the th birth? Does the brood size show asymptotic behaviour, and what are its bounds?
The Riddler, FiveThirtyEight, November 30, 2018(original post)
Solution
Define as the time of the th birth. Right after the th birth, the children’s ages are for (the most recent kid age zero). They wait until total work falls to : This is the recursion defining the birth schedule.
Infinitely many kids? For any , equation (207.1) has a unique positive solution for in . Reason: the left-hand side, as a function of , is continuous, strictly decreasing in , equal to at (since the newborn term blows up), and tends to as . So a unique crossing of exists. The schedule continues forever, and Alice and Bob have infinitely many children in the model: yes.
Does the inter-birth gap grow? For , the gap is the value of for which A new term has been added (the newest kid), and the older terms have each decreased compared to the previous step (their ages have increased). The dominant term is still (the newborn), so is close to but smaller than the value that solves , with the contribution from the older kids. As grows, grows (more terms, all positive), so must shrink and must grow. The numerical run confirms is monotonically increasing for .
Asymptotic for . Hypothesise for some constant . Then for with , For (early kids) this is ; for near this is (the difference dominated by ). Summing equation (207.1), Setting this equal to pins , so The numerical run confirms slowly from below.
Inter-birth gap and brood asymptotic. The gap from the same heuristic, also confirmed numerically. The brood at time is the largest with , that is, the inverse of at . Asymptotically, This is sub-linear in but unbounded: the brood grows without bound, more slowly than linearly.
The computation
Numerically solve equation (207.1) by bisection for each , then check the asymptotics and .
Initialise .
For each , solve by bisection in .
Set and record .
Compare and to for large .
import math
def schedule(M):
T = [0.0]
for n in range(2, M + 1):
ages = [T[-1] - ti for ti in T]
lo, hi = 1e-9, 1e9
for _ in range(200):
mid = (lo + hi) / 2
s = sum(1.0 / (a + mid) for a in ages)
lo, hi = (mid, hi) if s > 1 else (lo, mid)
T.append(T[-1] + hi)
return T
T = schedule(200)
for n in (2, 3, 5, 10, 50, 100, 200):
Tn = T[n - 1]
print(f"N={n}: T_N={Tn:.3f}, N ln N={n * math.log(n):.3f}, "
f"ratio={Tn / (n * math.log(n)):.4f}")
print()
print("Inter-birth gaps:")
for n in (2, 3, 5, 10, 50, 100, 200):
d = T[n - 1] - T[n - 2]
print(f"N={n}: delta={d:.3f}, ln(N)={math.log(n):.3f}, "
f"ratio={d / math.log(n):.4f}")
The script shows creeping up toward from below (already at ) and descending toward from above ( at ). Both ratios approach slowly, since the next-order correction is of order . The early values match the puzzle’s , exactly.