Skip to content
Vamshi Jandhyala

Books · The Fiddler: Solutions

Chapter 45

Can You Meet Me at the Mall?

You and two friends each arrive at the mall at a uniformly random time between 3 and 4 p.m., and each of you stays for exactly 1515 minutes. Over the afternoon, record the largest number of you present at the same moment. On average, what is that maximum?

The Fiddler, Zach Wissner-Gross, July 18, 2025(original post)

Solution

Measure time in hours, so each visit is an interval of length L=14L=\tfrac14 with a uniform start in [0,1][0,1]. Equal-length intervals all share a moment exactly when their starts fit in a window of length LL, so the maximum overlap is 11, 22, or 33 and E[max]=1+P(max2)+P(max3).E[\max]=1+P(\max\ge2)+P(\max\ge3). A pair overlaps unless every gap exceeds LL: P(max2)=1(12L)3=118=78P(\max\ge2)=1-(1-2L)^3=1-\tfrac18=\tfrac78. All three overlap when the range of the three starts is at most LL: P(max3)=3L22L3=532P(\max\ge3)=3L^2-2L^3=\tfrac{5}{32}. Hence E[max]=1+78+532=65322.031.E[\max]=1+\tfrac78+\tfrac{5}{32}=\frac{65}{32}\approx\boxed{2.031}.

The computation

Simulate the afternoon: draw three random arrival times, and since the largest crowd forms at someone’s arrival, count for each start how many visits cover it, and take the maximum. Average over millions of afternoons.

import numpy as np
rng = np.random.default_rng(0); t = np.sort(rng.random((4_000_000, 3)), axis=1)
best = np.ones(len(t), int)
for i in range(3):
    best = np.maximum(best, ((t >= t[:, i:i+1]) & (t <= t[:, i:i+1] + 0.25)).sum(1))
print(round(best.mean(), 4), 65/32)      # ~2.031  2.03125

Extra Credit

Now there are four friends, each arriving at random and staying 1515 minutes. On average, what is the maximum number together?

Solution

With four starts the overlap can reach 44. Using the spacings of four uniform points (joint density 24(1σ)24(1-\sigma) on the internal gaps), E[max]=1+(11256)2+551283+132564=3171282.477.E[\max]=1+\underbrace{\Bigl(1-\tfrac1{256}\Bigr)}_{\ge2}+\underbrace{\tfrac{55}{128}}_{\ge3}+\underbrace{\tfrac{13}{256}}_{\ge4} =\frac{317}{128}\approx\boxed{2.477}. (The source’s value is paywalled; this exact figure is my own.)

The computation

The same crowd count, now over four arrivals per afternoon.

rng = np.random.default_rng(1); t = np.sort(rng.random((20_000_000, 4)), axis=1)
best = np.ones(len(t), int)
for i in range(4):
    best = np.maximum(best, ((t >= t[:, i:i+1]) & (t <= t[:, i:i+1] + 0.25)).sum(1))
print(round(best.mean(), 4), 317/128)    # ~2.4766  2.4765625