Books · The Fiddler: Solutions
Chapter 3
Can You Fit the Stars on the Flag?
When Retsy Boss designed her new nation’s flag, she wanted the stars packed in tightly. The stars sit at the points of a square grid, one unit apart, and she kept only those whose centres lay within units of a single chosen point on the plane. Centred on a star, that rule admits stars. Placed freely, what is the greatest number of stars the rule can admit?
For extra credit, years on, the flag must carry one star for each of the nation’s states. As before, the chosen stars must all lie within some distance of a single point. What is the smallest for which the grid offers up such stars?
The Fiddler, Zach Wissner-Gross, July 3, 2026(original post)
Solution
The rule keeps every grid point inside a disk of radius , and the puzzle lets the disk float wherever it likes. Centring it on a star is the obvious move and the wrong one. It catches the four points at distance exactly , on the axes, but it wastes those four on the rim, where the slightest crowding would spill them out. A disk of radius has area , so points is already a point above what the area alone would suggest, and the four rim points are the reason. The question is whether floating the disk between grid lines can do better than balancing four points on the edge.
It can. Slide the disk so its centre sits near , halfway up between two rows and just off a column, and it swallows a solid block of points, the columns across the rows , with room to spare on one side for two more, and . That is (Figure 3.2, left).
To see that all really fit, put the centre at , level with the middle of the block. The two points reaching farthest to the right, and , sit at distance , and the two reaching farthest left, and , at distance . Both stay within precisely when a genuine interval, and the other ten points are nearer still. So a whole range of placements holds at once. No placement holds : the count changes only as the centre crosses one of the circles of radius drawn about the grid points, these circles cut the plane into finitely many cells with the count constant on each, and the pattern repeats with every unit square, so a sweep of one unit square settles the maximum. That sweep never reaches . The greatest number of stars is
Extra credit
Now the target is a count, stars, and the prize is the smallest disk that reaches it. For a fixed centre , the tightest disk holding points has radius equal to the distance from to its th-nearest grid point, so the task is to choose to bring that th point as close as possible.
Centre on a star and the grid points arrive in rings by squared distance . The counts accumulate to points out to squared distance , and the next ring, the four points with such as , brings the total past . So a star-centred disk needs radius , and it holds the th star only by stretching to that ring.
Floating the disk does better here too. The best centre is , off a column by an eighth and midway between two rows. Its four farthest admitted points are and , all at the same squared distance so they sit together on one rim, and inside that rim lie exactly points. The minimum distance is therefore Trading the star-centred disk for this one shaves the radius from down to , just enough to matter (Figure 3.2, right). The official solution had not yet been published at the time of writing, so both headline values above are my own, confirmed by the exhaustive sweep below.
The computation
Both parts are a search over where to put the centre, and the count is a step function of the centre that repeats with the unit square, so a fine sweep of one unit square is exhaustive. For the main puzzle the sweep records the most grid points a radius- disk can hold; for the extra credit it records, at each centre, the distance to the th-nearest grid point, and keeps the smallest.
import math
# MAIN: maximise the number of grid points in a CLOSED disk of radius 2.
# The count repeats with the unit square, so sweeping [0,1)^2 is exhaustive.
def count_in_disk(cx, cy, R=2.0):
r2, c = R*R + 1e-9, 0
for i in range(math.floor(cx-R)-1, math.ceil(cx+R)+2):
for j in range(math.floor(cy-R)-1, math.ceil(cy+R)+2):
if (i-cx)**2 + (j-cy)**2 <= r2:
c += 1
return c
best = max(count_in_disk(i/400, j/400) for i in range(401) for j in range(401))
print("MAIN: most stars in a radius-2 disk =", best)
# EC: minimise the radius that admits 58 points = min over centres of the
# 58th-nearest grid distance.
def kth_distance(cx, cy, k=58):
d = sorted((i-cx)**2 + (j-cy)**2 for i in range(-6, 7) for j in range(-6, 7))
return d[k-1] # squared distance to the k-th nearest point
bestR2 = min(kth_distance(i/400, j/400) for i in range(401) for j in range(201))
print(f"EC: min radius = sqrt({bestR2:.6f}) = {math.sqrt(bestR2):.6f}")
print(" R^2 as a fraction 1105/64 =", 1105/64, "; R = sqrt(1105)/8 =", math.sqrt(1105)/8)
# MAIN: most stars in a radius-2 disk = 14
# EC: min radius = sqrt(17.265625) = 4.155193
# R^2 as a fraction 1105/64 = 17.265625 ; R = sqrt(1105)/8 = 4.155192534648665
The sweep confirms both: at most stars fit inside a radius- disk, and the smallest disk holding has radius , attained at the centre .