Chapter 78
Can You Bake The Biggest Pie?
Riddler Classic
A fixed sheet of crust is formed, with no waste, into a sealed cylinder (top, bottom and side) holding the filling. To maximise the volume, what fraction of the crust should be the circular base?
Solution
The crust is all the cylinder’s surface: a top and bottom disc plus the side, total area , held fixed. Maximise the volume subject to that. With a Lagrange multiplier , setting : Substituting into the second equation gives , so : the optimal pie is as tall as it is wide (its height equals its diameter), the cylinder closest to a sphere. The base is then a fraction of the crust, with another sixth for the top and the remaining two-thirds for the side.
The computation
Hold the total crust area fixed and maximise the cylinder’s volume over its radius, then report the base’s share of the area.
import numpy as np
from scipy.optimize import minimize_scalar
A = 1.0 # fixed total crust area
def neg_vol(r):
h = (A - 2 * np.pi * r**2) / (2 * np.pi * r) # side + 2 discs use all crust
return -np.pi * r**2 * h
r = minimize_scalar(neg_vol, bounds=(1e-3, (A / (2 * np.pi))**0.5),
method='bounded').x
print(np.pi * r**2 / A) # 0.1667 = 1/6