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 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 adds to the pitcher.
First round. The glasses hold independent , and .
Second round. One glass holds the leftover (with ) and the other a fresh , so and .
Each round pours its minimum from both glasses, so the expected total, in ounces, is The minimum poured in round has survival function and expectation 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 now adds to the pitcher. The whole problem obeys one law: in the -glass process, the minimum poured in round satisfies , so ounces. Verifying the three rounds for (rounds give survival ), the answer is 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 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