Source: Reader Philippe Fondanaiche.
1 5 10 ---------------- 2 4 10 4 4 8 0 8 8
3 8 23 ---------------- 3 16 15 3 1 30 2 2 30 0 8 30
37 91 203 ---------------- 37 182 112 37 70 224 74 70 187 148 70 113 35 70 226 70 70 191 0 140 191
Since there are no other takers, here's a proof that you can empty a bottle for any a<=b<=c. Assume that, given a, b and c, the smallest amount we can have in a bottle (through any sequence of pourings) is x, which is greater than 0. Let y<=z be the amounts in the second and third bottles, and let k = [y/x], where [] is the greatest integer function. Put k in binary (1's and 0's), and, reading k from right to left, pour from the second bottle if there's a 1 and pour from the third bottle if there's a 0. If x divided y, then at the end of this process, the second bottle will be empty; otherwise, the second bottle will ultimately have less than x, creating a contradiction.
As an example of how this works, take 3, 8, 23. Suppose we assume
that 3 is the smallest amount we can ever have in a bottle. Now, k =
[8/3] = 2, which is 10 in binary. Reading k from right to left, we
encounter a 0 first, meaning we pour from the third bottle, getting 6,
8, 20. Since a 1 is next in the binary expression, we pour from the
second bottle next, getting, 12, 2, 20 - 2 being less 3. Now, we can
start anew with the triplet 2, 12, 20. This time, k = [12/2] = 6, which
is 110 in binary. So we pour from the third bottle - 4, 12, 18 - then
the second - 8, 8, 18 - then again the second - 16, 0, 18. Of course,
this is not the fastest way, but it always works.
-Craig Gentry
ts208@is5.nyu.edu