Skip to content
Vamshi Jandhyala

Books · The Riddler

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 11 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 3×33\times 3 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 8.\boxed{8}.

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 88.

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 66'' mark runs from the nearest break below 66 (or the end at 00) up to the nearest break above 66 (or the end at 1212). Each break lands left or right of 66 independently with probability 12\tfrac12, and restricted to a side it is uniform on that 66'' half. For mm uniform points on a length-66 interval, the expected distance from the end to the nearest point is 6/(m+1)6/(m+1) (the first order statistic), and with no points on a side the distance is the full 66.

Split on how the three breaks fall:

  • All three on one side (probability 2(12)3=142\cdot(\tfrac12)^3 = \tfrac14): the empty side contributes 66, the loaded side contributes 6/4=1.56/4 = 1.5, total 7.57.5.

  • Two on one side, one on the other (probability 34\tfrac34): the two-break side contributes 6/3=26/3 = 2, the one-break side contributes 6/2=36/2 = 3, total 55.

Therefore the expected length is 14(7.5)+34(5)=1.875+3.75=5.625 inches\tfrac14(7.5) + \tfrac34(5) = 1.875 + 3.75 = \boxed{5.625\ \text{inches}} (=458=\tfrac{45}{8}), longer than the average piece (12/4=312/4 = 3): 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 5.6255.625 inches, or 458\tfrac{45}{8}.