Skip to content
Vamshi Jandhyala

Books · The Riddler

Chapter 109

Can You Solve The Puzzle Of The Picky Eater?

You make a sandwich on perfectly square bread, and you loathe the crust so deeply that you will eat only the part of the sandwich that is closer to the centre than to the edge. What fraction of the sandwich do you eat? Extra credit: which regular bread shape lets a crust-hater eat the most?

The Riddler, FiveThirtyEight (inspired by @hatathi)(original post)

Solution

The edible region is bounded by parabolas, and pinning down one of them gives 425321.9%.\boxed{\dfrac{4\sqrt2-5}{3}\approx 21.9\%}.

The one idea is the definition of a parabola: the points equidistant from a fixed point and a fixed line. “Closer to the centre than to a given edge” is precisely the inside of the parabola with the centre as focus and that edge as directrix. The square has four edges, so four parabolas, and the edible piece is the region inside all four at once.

Make the bread the square x1\lvert x\rvert\le1, y1\lvert y\rvert\le1, centre at the origin, total area 44. Split it along its two diagonals into four congruent triangles; by symmetry, work in the right-hand one, where the nearest edge is the line x=1x=1. A point there is edible when it is nearer the origin than that edge, x2+y2<1xy2<12xx<1y22.\sqrt{x^2+y^2}<1-x \quad\Longleftrightarrow\quad y^2<1-2x \quad\Longleftrightarrow\quad x<\frac{1-y^2}{2}. Within the triangle a point also satisfies yx\lvert y\rvert\le x, and combining yx<1y22\lvert y\rvert\le x<\frac{1-y^2}{2} forces y21\lvert y\rvert\le\sqrt2-1. Writing a=21a=\sqrt2-1, the edible area of this one triangle is aa ⁣(1y22y)dy=2 ⁣0a ⁣(1y22y)dy=4253.\int_{-a}^{a}\!\Bigl(\frac{1-y^2}{2}-\lvert y\rvert\Bigr)\,dy =2\!\int_{0}^{a}\!\Bigl(\frac{1-y^2}{2}-y\Bigr)dy =\frac{4\sqrt2-5}{3}. Each triangle has area 11 and the whole square has area 44, so this triangle’s edible area already is the fraction for the whole sandwich: 42530.219\tfrac{4\sqrt2-5}{3}\approx0.219. You throw away nearly four-fifths of your lunch.

Extra credit. For a regular polygon the same four-becomes-nn argument applies, and as the number of sides grows the bread tends to a circle, for which “closer to the centre than the rim” is simply the disc of half the radius, an edible quarter. More sides means more edible area, approaching 25%25\%. So the crust-hater’s ideal bread is round.

The computation

No need to trust the algebra: scatter points across the square and ask each whether it sits nearer the centre than the nearest edge.

import numpy as np
rng = np.random.default_rng(0)
N = 20_000_000
x, y = rng.uniform(-1, 1, N), rng.uniform(-1, 1, N)
d_center = np.hypot(x, y)
d_edge = 1 - np.maximum(np.abs(x), np.abs(y))    # nearest of the four edges
print(round((d_center < d_edge).mean(), 5),
      round((4 * 2**0.5 - 5) / 3, 5))
# 0.21902 0.21895