Library · The Fiddler: Solutions · Chapter 124
Can You Save the Pizza?
I have a slice of uneaten pizza to wrap in aluminium foil before it goes in the fridge, and I am out of foil. My neighbour has huge sheets of it, and will lend me some in exchange for babysitting their pet snake: one minute of babysitting for every square inch of foil. I hate snakes, so I want the bare minimum.
The slice is an equilateral triangle with sides of inches. I want the smallest rectangle of foil, by area, with which I can completely cover the slice above and below. I cannot fold the pizza, but I may make as many straight folds in the foil as I like, without tearing it. What is the area of the smallest such rectangle?
The Fiddler, Zach Wissner-Gross, March 15, 2024(original post)
The official solution appeared in the post of March 22, 2024. It accepted both square inches and square inches, calling the second the technically correct answer. The analysis below agrees, and adds that can be approached as closely as you like but never reached. For the Extra Credit the official declined to name right or wrong answers, so that analysis is my own.
Solution
Treat the slice as a flat equilateral triangle with no thickness, so that it has a top face and a bottom face, joined along its three edges. Folding the foil bends it along straight lines but never stretches it, so each flat piece of folded foil keeps its area.
A floor. Every point of both faces must have foil over it. Each face is an equilateral triangle of side , with area . Foil cannot cover more area than it has, so any wrapping uses at least This floor would be reached only by a wrapping with no overlap and no overhang at all, which looks far too good to be possible.
A few folds. The official solution collects a run of better and better wrappings sent in by solvers. The simplest is a rectangle with the slice inscribed in it, doubled so that half folds over the top: . Lise Andreasen’s rectangle holds a rhombus of two copies of the slice and folds along their common edge: . Tom Keith’s placement, with three flaps that each cover part of the top, needs . The best the official found with one fold along each edge is a square of side , with the slice placed so that the three flaps folded over its edges meet at a single point on top: . All of these are a long way above the floor, because large flaps of foil overhang the slice or lie on top of each other.
Many folds. The rules allow any number of folds, and that changes everything. Cut the foil as a long, thin strip of width , and wind it round the slice in rows parallel to the base, like a bandage, as in the figure.
Run the strip along the bottom row on the top face, past the right-hand edge of the slice, and fold it straight back underneath, so that it runs back along the same row on the bottom face.
Past the left-hand edge, turn it up into the next row with a U-turn made of two folds at , still underneath.
Run it along that row on the bottom face, fold it over the right-hand edge onto the top face, run it back, make a U-turn on top into the third row, and so on up to the tip.
Every fold and every U-turn happens just beyond the edge of the slice, so the strip covers each row once on top and once underneath.
How much foil does this use? Row by row, the foil on each face is a rectangle tall reaching across the widest part of that row, so it covers the slice’s area plus three kinds of waste, each a small multiple of :
at the two slanted edges each row’s rectangle overhangs the slice by two little right triangles with legs and , an area of per row on each face;
each row’s first pass starts at the U-turn, further left than it needs to, another per row;
each U-turn uses about of strip, an area of .
There are about rows, so the waste adds up to about The foil, a by rectangle for the right length , has area about . A strip a tenth of an inch wide already uses less than square inches, beating every few-fold wrapping, and by narrowing the strip the area comes as close to as you like.
The floor is never reached. Suppose some rectangle of area exactly did the job. Then nothing could be wasted: no foil could overhang the slice and no two layers could overlap, apart from lines and points that have no area. The folds divide the foil into flat pieces, and these pieces would fit together on the two faces exactly, like the tiles of a floor.
Now look at a corner of the slice. Walking once round on the surface, you pass through on the top face and on the bottom face, only in all. The pieces of foil with a corner at must fill exactly those , without overlapping. Each of them comes from some point of the original sheet, and folding keeps angles, so all the foil around must be packed into the space around . If were inside the sheet, that would be of foil packed into , which is impossible without overlap. So lies on the border of the sheet: on a side, with of foil around it, or at a corner of the rectangle, with . The angles must add up to exactly . One corner gives only , and anything more gives at least . No choice works, so no rectangle of area exactly can wrap the slice.
So there is no smallest rectangle. Every area above the floor can be achieved, and the floor itself cannot. The foil can be cut down to If the puzzle intends a sensible number of folds, the official’s square inches is the best wrapping it reports with one fold along each edge.
The computation
The program builds the strip wrapping as described, for strips of decreasing width. It records each pass of the strip (which face, which row, and where it starts and ends) and adds up the strip’s length, allowing for each U-turn. Then it checks the wrapping: it throws random points onto the slice and confirms that every one of them is covered on both faces. The foil area falls towards the floor, and the waste per unit of width settles at about , as estimated.
import math, random
S3 = math.sqrt(3)
H = 5 * S3 # height of the slice
def strip_wrap(w, extent):
"""Wind a strip of width w round a flat shape of height H, row by row
(rows parallel to the base), covering both faces. extent(y0, y1) is the
widest x-range of the shape between heights y0 and y1.
Returns the passes (face, row, x_from, x_to) and the strip's length."""
n = math.ceil(H / w)
rows = [extent(j * w, (j + 1) * w) for j in range(n)]
passes, length = [], 2 * w * (n - 1) # each U-turn uses 2w of strip
for j, (a, b) in enumerate(rows):
first, second = ("top", "bottom") if j % 2 == 0 else ("bottom", "top")
start = min(a, rows[j - 1][0]) if j else a # coming out of the U-turn
passes += [(first, j, start, b), (second, j, a, b)]
length += (b - start) + (b - a)
return passes, length
def try_strip(w, extent, inside, rng):
"""Foil area used, and whether random points of both faces are all covered."""
passes, length = strip_wrap(w, extent)
span = {}
for face, j, a, b in passes:
span.setdefault((face, j), []).append((a, b))
ok = True
for _ in range(20_000):
x, y = 16 * rng.random(), H * rng.random()
if inside(x, y):
j = int(y // w)
ok &= all(any(a <= x <= b for a, b in span.get((face, j), []))
for face in ("top", "bottom"))
return w * length, ok
slice_extent = lambda y0, y1: (y0 / S3, 10 - y0 / S3)
in_slice = lambda x, y: y <= S3 * min(x, 10 - x)
rng = random.Random(315)
print(f"lower bound 50 sqrt(3) = {50 * S3:.4f}")
for w in (1, 0.1, 0.01, 0.001):
area, ok = try_strip(w, slice_extent, in_slice, rng)
print(f"w = {w:<6} area {area:8.4f} excess/w {(area - 50 * S3) / w:5.1f} covered {ok}")
It prints
lower bound 50 sqrt(3) = 86.6025
w = 1 area 117.4804 excess/w 30.9 covered True
w = 0.1 area 89.8218 excess/w 32.2 covered True
w = 0.01 area 86.9257 excess/w 32.3 covered True
w = 0.001 area 86.6349 excess/w 32.3 covered True
Extra Credit
Now I want to wrap two slices in a single rectangle of foil. The slices may touch, but they cannot overlap, and both the top and the bottom of each must be completely covered. What is the area of the smallest such rectangle?
Solution
Every argument from the main problem carries over.
The floor doubles. There are now four triangular faces of area to cover, so any wrapping uses at least square inches.
The strip still approaches the floor. Lay the two slices side by side so that they share an edge and form a rhombus with angles of and . The rhombus is a flat shape of the same height, , and the strip can be wound round it row by row exactly as before, with every fold and U-turn just beyond its slanted sides. Each row now spans both slices, and the foil crossing the shared edge lies flat across it. The waste is again a fixed multiple of , so the area tends to as shrinks.
The floor is still never reached. The corner argument looked only at the foil near one corner of one slice, and a slice’s corner is still surrounded by just of its own surface, whatever the other slice is doing. So the foil can be cut down to
The computation
The same program from the main problem winds the strip round the rhombus instead of the single slice, now checking random points on both slices.
rhombus_extent = lambda y0, y1: (y0 / S3, 10 + y1 / S3)
in_rhombus = lambda x, y: y / S3 <= x <= 10 + y / S3
print(f"lower bound 100 sqrt(3) = {100 * S3:.4f}")
for w in (1, 0.1, 0.01, 0.001):
area, ok = try_strip(w, rhombus_extent, in_rhombus, rng)
print(f"w = {w:<6} area {area:8.4f} covered {ok}")
It prints
lower bound 100 sqrt(3) = 173.2051
w = 1 area 211.0111 covered True
w = 0.1 area 177.2211 covered True
w = 0.01 area 173.7233 covered True
w = 0.001 area 173.2523 covered True