Books · The Fiddler: Solutions
Chapter 43
Can You Squeeze the Squares?
A square board has side length . Your friend cleverly places one unit square anywhere on the board. You must then place a second unit square, entirely on the board and not overlapping the first (touching is allowed), no matter how adversarially the first was placed. What is the smallest for which you can always succeed?
The Fiddler, Zach Wissner-Gross, August 1, 2025(original post)
Solution
The friend’s strongest move is to centre the unit square, leaving a symmetric frame of width on every side. A unit square needs a clear run of at least in some direction, and a rotated square only needs more room (its minimum width is , achieved axis-aligned), so the largest square that fits in a corner has side exactly . You can always place the second square precisely when At the corner square is tangent to the centre square at , which counts; below the centred square blocks every position.
The computation
Encode the placement test with the separating-axis theorem: two squares miss exactly when some edge-normal separates them. Then sweep a candidate second square over positions and angles to see whether any placement avoids the centred blocker and stays on the board. It fails just below and succeeds just above.
import numpy as np
def corners(cx, cy, th):
h = .5; P = np.array([[-h,-h],[h,-h],[h,h],[-h,h]])
R = np.array([[np.cos(th),-np.sin(th)],[np.sin(th),np.cos(th)]]); return P@R.T + [cx,cy]
def overlap(A, B, e=1e-9):
for P in (A, B):
for i in range(4):
E = P[(i+1)%4] - P[i]; ax = np.array([-E[1], E[0]]); a = A@ax; b = B@ax
if a.min() > b.max() - e or b.min() > a.max() - e: return False
return True
def fits(bl, L, ng=80, na=16):
cs = np.linspace(0, L, ng)
for th in np.linspace(0, np.pi/2, na, endpoint=False):
for cx in cs:
for cy in cs:
C = corners(cx, cy, th)
if C.min() >= -1e-9 and C.max() <= L + 1e-9 and all(not overlap(C, b) for b in bl):
return True
return False
for A in (2.9, 3.1): # 3.0 is the exact tangent threshold
print(A, fits([corners(A/2, A/2, 0)], A)) # 2.9 -> False, 3.1 -> True
Extra Credit
Now the friend places three unit squares (which may touch but not overlap) on a board of side , and you must add a fourth. What is the smallest for which you can always succeed?
Solution
Three blockers cannot shrink all four corners at once, so a purely central defence no longer pins the answer; the optimal arrangement is an off-centre, pinwheel-like trio. This is a delicate continuous min–max. A search gives a verified blocking arrangement at (no fourth square fits even under a fine position-and-angle sweep), while the defender succeeds throughout an extensive search by about , so (The exact value is paywalled; the bound below is my own.)
The computation
Reuse the same fits test on the pinwheel blocker at : sweeping a grid of positions over angles finds no legal spot for a fourth square.
bl = [corners(2.181, 2.233, 0.802), corners(1.629, 0.957, 0.835), corners(0.711, 2.559, 0.516)]
print(fits(bl, 3.3, ng=200, na=60)) # False -> no fourth square fits anywhere