Chapter 276
Are You Hip Enough To Be Square?
The Riddler for August 14, 2020. The Express is a Martin Gardner packing puzzle about how many unit squares can each clip a single blue unit square, and the Classic averages the length of the ruler piece that holds the six-inch mark.
Riddler Express
You have a large pile of unit squares (side inch). One is blue; the rest are white. Arrange white squares so each covers a nonzero part of the blue square, but no two white squares overlap each other. (The blue square need not be fully covered.) What is the greatest number of white squares you can place?
The Riddler, FiveThirtyEight, August 14, 2020(original post)
Solution
This is a variant of a Martin Gardner packing problem, and the count climbs as you abandon symmetry. A grid of white squares laid over the blue one and then rotated leaves at most five squares actually clipping the blue square, so axis-aligned thinking undershoots. Tilting the squares does better: seven fit in a rotated honeycomb pattern, each poking a corner into the blue square while staying clear of its neighbours. Pushing further, a slightly asymmetric tilt makes room for an eighth square in the central gap. Nine cannot be done, as Gardner established for this packing. The greatest number is
Deferred (hand construction)
The optimal arrangement is a bespoke, asymmetric tilt of eight unit squares, exhibited in the original column by figure rather than by formula. There is no tidy closed form or canonical coordinate set: the eighth square depends on a hand-tuned placement, and a generic numerical packing search does not converge on it cleanly (each added square must claim a nonzero slice of the blue square while every pair of white squares stays disjoint, a brittle constraint near the optimum). The construction is therefore deferred to the source figure; the established maximum is .
Riddler Classic
A foot-long ruler is sliced at three independent uniformly random points, giving four pieces. On average, how long is the piece that contains the six-inch mark?
The Riddler, FiveThirtyEight, August 14, 2020(original post)
Solution
The piece holding the mark runs from the nearest break below (or the end at ) up to the nearest break above (or the end at ). Each break lands left or right of independently with probability , and restricted to a side it is uniform on that half. For uniform points on a length- interval, the expected distance from the end to the nearest point is (the first order statistic), and with no points on a side the distance is the full .
Split on how the three breaks fall:
All three on one side (probability ): the empty side contributes , the loaded side contributes , total .
Two on one side, one on the other (probability ): the two-break side contributes , the one-break side contributes , total .
Therefore the expected length is (), longer than the average piece (): the piece straddling a fixed point is size-biased toward being long.
The computation
Encode the problem twice: a Monte Carlo over random triples of breaks, and the exact order-statistic case split.
import random
rng = random.Random(0)
N, tot = 2_000_000, 0.0
for _ in range(N):
b = sorted(rng.uniform(0, 12) for _ in range(3))
lo = max([x for x in b if x < 6], default=0.0) # nearest break below 6
hi = min([x for x in b if x > 6], default=12.0) # nearest break above 6
tot += hi - lo
print(round(tot / N, 3)) # 5.626 (MC; exact 5.625)
exact = 0.25 * (6 + 6/4) + 0.75 * (6/3 + 6/2) # 0.25*7.5 + 0.75*5
print(exact) # 5.625
Both routes give inches, or .