Skip to content
Vamshi Jandhyala

Books · The Riddler

Chapter 105

Can You Solve The Puzzle Of The Overflowing Martini Glass?

Your martini glass is a cone. You have drunk enough that, with the glass held upright, the drink reaches a fraction pp of the way up the side. Now tip the glass down on one side, just to the point of overflowing. How far up the opposite side does the drink now reach?

The Riddler, FiveThirtyEight (anonymous)(original post)

Solution

Tipping the glass rearranges the drink but does not add or remove a drop, so the one fixed quantity is the liquid’s volume. Pin that volume down twice, once upright and once tipped, and the answer falls out as a startlingly clean p2.\boxed{p^2}. The drink ends up a fraction p2p^2 of the way up the far side.

Here is why. Scale the glass to height and radius 11 (the answer is a ratio of lengths, so the particular size cannot matter). Upright, the drink is a small cone similar to the glass, reaching height pp, so its volume is π3p3\tfrac{\pi}{3}p^3, the fraction p3p^3 of the full glass.

Tipped to the brim, the drink’s flat surface slices the cone in an ellipse, and the liquid is a cone again, only now leaning: its tip is the bottom of the glass and its base is that ellipse. The volume of any cone, upright or leaning, is 13\tfrac13 (base area) ×\times (height), and the elliptical base has area πab\pi a b for semi-axes aa and bb. Write xx for the fraction the drink reaches up the far side, the quantity we want. Two facts fix the shape.

The major axis and the height. Slice the whole picture down the plane of symmetry. The cone becomes a triangle with its apex at the glass’s point, and the drink’s surface becomes the chord running from the brim on the near side to the height xx on the far side. With the glass scaled to 11, the near rim sits at (1,1)(1,1) and the far point at (x,x)(-x,x) in this slice, so the triangle (apex at the origin) has area 121x(x)1=x\tfrac12\lvert 1\cdot x - (-x)\cdot 1\rvert = x. That same triangle has the major axis 2a2a for its base and the cone’s height hh for its altitude, so 12(2a)h=ah=x\tfrac12(2a)h = ah = x.

The minor axis. The ellipse’s short axis is the horizontal chord of the cone through the ellipse’s centre. The centre sits at radius r=x+12r=\tfrac{x+1}{2} along the glass and a distance d=1x2d=\tfrac{1-x}{2} off the cone’s axis, so the half-chord is b=r2d2=xb=\sqrt{r^2-d^2}=\sqrt{x}.

Now assemble the tipped volume and set it equal to the upright one, π3abh=π3(ah)b=π3xx=π3p3x3/2=p3x=p2.\begin{aligned} \frac{\pi}{3}\,a b\,h=\frac{\pi}{3}\,(ah)\,b=\frac{\pi}{3}\,x\sqrt{x}=\frac{\pi}{3}p^3\\ \Longrightarrow\quad x^{3/2}=p^3 \quad\Longrightarrow\quad x=p^2 . \end{aligned} Group the volume as (ah)b(ah)\cdot b and the two facts slot straight in. The square is the whole surprise: a glass two-thirds full up the side (p=23p=\tfrac23) tips to just 49\tfrac49 up the other side.

The computation

No clever geometry in the check, just the conserved volume. Fill the cone with random points, tilt a plane through the near rim until the drink below it is the right fraction p3p^3 of the glass, and read off where that plane meets the far edge.

import numpy as np
rng = np.random.default_rng(0)
N = 4_000_000                  # cone: apex down, height 1, radius 1
X, Z = rng.uniform(-1, 1, N), rng.uniform(0, 1, N)
inside = X * X + rng.uniform(-1, 1, N) ** 2 <= Z * Z
X, Z, n = X[inside], Z[inside], inside.sum()

def far_reach(p):              # plane z = a*X + (1-a) thru near rim
    lo, hi = 0.0, 1.0
    for _ in range(50):
        a = (lo + hi) / 2
        frac = (Z <= a * X + (1 - a)).sum() / n   # drink / glass volume
        lo, hi = (a, hi) if frac > p**3 else (lo, a)   # hit fraction p^3
    a = (lo + hi) / 2
    return (1 - a) / (1 + a)    # where the plane meets the far edge

for p in (0.4, 0.6, 0.8):
    print(f"p={p}: far reach {far_reach(p):.4f},  p^2={p*p:.4f}")
# p=0.4: far reach 0.1602,  p^2=0.1600
# p=0.6: far reach 0.3596,  p^2=0.3600
# p=0.8: far reach 0.6400,  p^2=0.6400