Skip to content
Vamshi Jandhyala

Books · The Fiddler: Solutions

Chapter 7

Can You Drink the “Random-ade”?

I’m preparing a mixture of “random-ade” using a large, empty pitcher and two 12-ounce glasses. First, I fill one glass with some amount of lemon juice chosen randomly and uniformly between 0 and 12 ounces. I fill the other glass with some amount of water, also chosen randomly and uniformly between 0 and 12 ounces. Next, I pour an equal amount from each glass into the pitcher until one of the glasses is empty. At this point, I refill that empty glass with yet another random amount of the same liquid it previously contained. Once again, I pour an equal amount from each glass into the pitcher until one of the glasses is empty. On average, how much random-ade can I expect to prepare?

The Fiddler, Zach Wissner-Gross, May 8, 2026(original post)

Solution

Work in units of a full glass, so each fill is uniform on [0,1][0,1] and we scale by 12 at the end. A pouring round transfers the minimum of the current glass contents from each glass, so a round with minimum mm adds 2m2m to the pitcher.

First round. The glasses hold independent X,YU(0,1)X, Y \sim \mathrm{U}(0,1), and E[min(X,Y)]=01(1t)2dt=13\mathbb{E}[\min(X,Y)] = \int_0^1 (1-t)^2\,dt = \tfrac13.

Second round. One glass holds the leftover D=XYD = |X-Y| (with Pr(D>t)=(1t)2\Pr(D>t)=(1-t)^2) and the other a fresh ZU(0,1)Z \sim \mathrm{U}(0,1), so Pr(min(D,Z)>t)=(1t)3\Pr(\min(D,Z)>t)=(1-t)^3 and E[min(D,Z)]=14\mathbb{E}[\min(D,Z)]=\tfrac14.

Each round pours its minimum from both glasses, so the expected total, in ounces, is 2(123+124)=2(4+3)=14 ounces.2\left(\tfrac{12}{3} + \tfrac{12}{4}\right) = 2\,(4 + 3) = \boxed{14 \text{ ounces}}. The minimum poured in round jj has survival function (1t)1+j(1-t)^{1+j} and expectation 12/(2+j)12/(2+j) ounces, as the extra credit shows.

The computation

Run the recipe: fill two glasses uniformly, pour out the smaller amount from each (adding twice it to the pitcher), refill the emptied glass, pour again, and average the pitcher total over millions of batches.

import random
n, tot = 10**7, 0.0
for _ in range(n):
    x, y = 12*random.random(), 12*random.random()
    m1 = min(x, y)
    d, z = abs(x - y), 12*random.random()
    m2 = min(d, z)
    tot += 2*(m1 + m2)
print(tot/n)        # 13.999... ~ 14

Extra Credit

Now there are three 12-ounce glasses: lemon juice, lime juice and water, each filled with an independent uniform amount. Pour equally from all three until one empties; refill that glass; pour again until one empties; refill; pour a third time until one empties, and stop. On average, how much random-ade is prepared?

Solution

Round jj now adds 3mj3m_j to the pitcher. The whole problem obeys one law: in the gg-glass process, the minimum poured in round jj satisfies Pr(mj>t)=(1t)g+j1\Pr(m_j > t) = (1-t)^{\,g+j-1}, so E[mj]=12/(g+j)\mathbb{E}[m_j] = 12/(g+j) ounces. Verifying the three rounds for g=3g=3 (rounds give survival (1t)3,(1t)4,(1t)5(1-t)^3,(1-t)^4,(1-t)^5), the answer is 3(124+125+126)=3(3+2.4+2)=1115=22.2 ounces.3\left(\frac{12}{4} + \frac{12}{5} + \frac{12}{6}\right) = 3\,(3 + 2.4 + 2) = \boxed{\tfrac{111}{5} = 22.2 \text{ ounces}}. The two-glass answer fits the same law. (The source’s value is behind its paywall; this is my own.)

The computation

Simulate the three-glass recipe the same way, and separately confirm the round-three survival law (1t)5(1-t)^5 exactly by integrating the leftover/fresh-fill cases against the order-statistic density with sympy.

import random
n, tot = 2*10**6, 0.0
for _ in range(n):
    g = [12*random.random() for _ in range(3)]
    for rnd in range(3):
        m = min(g); tot += 3*m
        g = [x - m for x in g]
        if rnd < 2: g[g.index(0.0)] = 12*random.random()
print(tot/n)        # 22.20... ~ 111/5

import sympy as sp  # exact round-3 survival
s2, s3, t, f = sp.symbols('s2 s3 t f', nonnegative=True)
inner = sp.integrate(6*(1-s2-s3)*(1-s2-t), (s2, 0, 1-s3))
P1 = sp.integrate(inner, (s3, t, 1))
P2 = sp.integrate((1-f-t)**3, (f, 0, 1-t))
print(sp.factor((1-t)*(P1+P2)))          # -(t - 1)**5