Skip to content
Vamshi Jandhyala

Books · The Fiddler: Solutions

Chapter 24

Some Coffee With Your Tea?

One glass holds exactly 1212 fluid ounces of coffee, another exactly 1212 fluid ounces of tea. Pour one ounce from the coffee glass into the tea glass and mix thoroughly. Then pour one ounce from the (mostly) tea glass back into the coffee glass and mix. Is there now more coffee in the tea glass, or more tea in the coffee glass?

The Fiddler, Zach Wissner-Gross, January 9, 2026(original post)

Solution

They are exactly equal, and no arithmetic is needed. Both glasses start and end with 1212 ounces. So whatever volume of coffee has left the coffee glass for good must have been replaced by an equal volume of tea, simply to keep the coffee glass at 1212 ounces. The coffee that left now sits in the tea glass; the tea that arrived is the tea now in the coffee glass. These two volumes are equal: the same amount.\boxed{\text{the same amount.}} Tracking the ounces confirms it. After the first pour the tea glass holds 1313 ounces, 113\tfrac1{13} of it coffee; the ounce poured back therefore carries 113\tfrac1{13} ounce of coffee and 1213\tfrac{12}{13} ounce of tea. The coffee glass ends with 1213\tfrac{12}{13} ounce of tea, and the tea glass ends with 1113=12131-\tfrac1{13}=\tfrac{12}{13} ounce of coffee.

The computation

Carry out the two pours on the actual contents, tracking the coffee and tea in each glass and transferring in proportion to the current mix. Both cross-contaminations come out to 1213\tfrac{12}{13} ounce.

from fractions import Fraction as F
coffee, tea = {'C': F(12), 'T': 0}, {'C': 0, 'T': F(12)}
def pour(src, dst, v):
    tot = src['C'] + src['T']
    for k in ('C', 'T'):
        amt = v * src[k] / tot; src[k] -= amt; dst[k] += amt
pour(coffee, tea, 1); pour(tea, coffee, 1)
print(tea['C'], coffee['T'])            # 12/13  12/13  -> equal

Extra Credit

Now both glasses can hold up to 2424 ounces; one starts with 1212 ounces of coffee, the other with 1212 ounces of tea. To dilute the coffee glass you repeat: pour some volume of tea in, mix, then pour that same volume down the sink so 1212 ounces remain. Doing this as often as you like, what is the least coffee you can be left with in the glass?

Solution

Each wash adds vv ounces of tea to the 1212 already present, then discards a fraction v/(12+v)v/(12+v) of the now-uniform mixture, so the coffee is multiplied by 12/(12+v)12/(12+v). The whole tea glass holds only 1212 ounces, so the wash volumes obey vi=12\sum v_i = 12. By the AM–GM inequality the dilution is best with kk equal washes vi=12/kv_i=12/k, leaving 12(kk+1)k    12e=4.41 ounces12\left(\frac{k}{k+1}\right)^{k}\;\longrightarrow\;\frac{12}{e} = \boxed{4.41\ldots\text{ ounces}} as the washes grow ever more numerous and ever smaller. (The source’s value is behind its paywall; this is my own.)

The computation

Run the washes: for kk equal pours of v=12/kv=12/k, multiply the coffee by its dilution factor 12/(12+v)12/(12+v) each time. As kk grows the leftover coffee falls toward 12/e12/e.

import numpy as np
def wash(k):
    coffee = 12.0; v = 12.0/k
    for _ in range(k): coffee *= 12/(12 + v)     # add v tea, mix, discard v
    return coffee
for k in (1, 2, 10, 1000):
    print(k, round(wash(k), 5))
print("limit 12/e =", round(12/np.e, 5))         # 4.41455