Library · The Fiddler: Solutions · Chapter 124

Can You Save the Pizza?

Revised Report an error

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 1010 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 112.5112.5 square inches and 50350\sqrt3 square inches, calling the second the technically correct answer. The analysis below agrees, and adds that 50350\sqrt3 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 1010, with area 34⋅102=253\tfrac{\sqrt3}{4} \cdot 10^2 = 25\sqrt3. Foil cannot cover more area than it has, so any wrapping uses at least 2×253  =  503  ≈  86.6 square inches.2 \times 25\sqrt3 \;=\; 50\sqrt3 \;\approx\; 86.6 \text{ square inches.} 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: 1003≈173.2100\sqrt3 \approx 173.2. Lise Andreasen’s rectangle holds a rhombus of two copies of the slice and folds along their common edge: 753≈129.975\sqrt3 \approx 129.9. Tom Keith’s placement, with three flaps that each cover part of the top, needs 20033≈115.5\tfrac{200}{3}\sqrt3 \approx 115.5. The best the official found with one fold along each edge is a square of side 7.527.5\sqrt2, with the slice placed so that the three flaps folded over its edges meet at a single point on top: 112.5112.5. 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 ww, 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 45∘45^\circ, 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.

Winding a strip round the slice, here with only five rows. Solid lines run on the top face and dashed lines underneath. On the right the strip folds over to the other face; on the left it makes a U-turn into the next row. The shaded rows show the foil laid on each face.
Winding a strip round the slice, here with only five rows. Solid lines run on the top face and dashed lines underneath. On the right the strip folds over to the other face; on the left it makes a U-turn into the next row. The shaded rows show the foil laid on each face.

How much foil does this use? Row by row, the foil on each face is a rectangle ww 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 ww:

  • at the two slanted edges each row’s rectangle overhangs the slice by two little right triangles with legs ww and w/3w/\sqrt3, an area of w2/3w^2/\sqrt3 per row on each face;

  • each row’s first pass starts at the U-turn, w/3w/\sqrt3 further left than it needs to, another w2/3w^2/\sqrt3 per row;

  • each U-turn uses about 2w2w of strip, an area of 2w22w^2.

There are about 53/w5\sqrt3/w rows, so the waste adds up to about 53w(2w23+w23+2w2)  =  (15+103)w  ≈  32.3 w.\frac{5\sqrt3}{w}\left(\frac{2w^2}{\sqrt3} + \frac{w^2}{\sqrt3} + 2w^2\right) \;=\; \left(15 + 10\sqrt3\right) w \;\approx\; 32.3\,w . The foil, a ww by ℓ\ell rectangle for the right length ℓ\ell, has area about 503+32.3 w50\sqrt3 + 32.3\,w. A strip a tenth of an inch wide already uses less than 9090 square inches, beating every few-fold wrapping, and by narrowing the strip the area comes as close to 50350\sqrt3 as you like.

The floor is never reached. Suppose some rectangle of area exactly 50350\sqrt3 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 CC of the slice. Walking once round CC on the surface, you pass through 60∘60^\circ on the top face and 60∘60^\circ on the bottom face, only 120∘120^\circ in all. The pieces of foil with a corner at CC must fill exactly those 120∘120^\circ, without overlapping. Each of them comes from some point pp of the original sheet, and folding keeps angles, so all the foil around pp must be packed into the space around CC. If pp were inside the sheet, that would be 360∘360^\circ of foil packed into 120∘120^\circ, which is impossible without overlap. So pp lies on the border of the sheet: on a side, with 180∘180^\circ of foil around it, or at a corner of the rectangle, with 90∘90^\circ. The angles must add up to exactly 120∘120^\circ. One corner gives only 90∘90^\circ, and anything more gives at least 180∘180^\circ. No choice works, so no rectangle of area exactly 50350\sqrt3 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  as close to 503≈86.6 square inchesas you like, but never equal to it \boxed{\ \begin{array}{c} \text{as close to } 50\sqrt3 \approx 86.6 \text{ square inches} \\ \text{as you like, but never equal to it} \end{array} \ } If the puzzle intends a sensible number of folds, the official’s 112.5112.5 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 2w2w for each U-turn. Then it checks the wrapping: it throws 20,00020{,}000 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 32.332.3, 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 25325\sqrt3 to cover, so any wrapping uses at least 1003≈173.2100\sqrt3 \approx 173.2 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 60∘60^\circ and 120∘120^\circ. The rhombus is a flat shape of the same height, 535\sqrt3, 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 ww, so the area tends to 1003100\sqrt3 as ww 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 120∘120^\circ of its own surface, whatever the other slice is doing. So the foil can be cut down to  as close to 1003≈173.2 square inchesas you like, but never equal to it \boxed{\ \begin{array}{c} \text{as close to } 100\sqrt3 \approx 173.2 \text{ square inches} \\ \text{as you like, but never equal to it} \end{array} \ }

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
Report an error on this page

Reports are stored by Netlify. See the privacy note.