Gallons of strife in balancing measures safely

By Burkard Polster and Marty Ross

The Age, 14 April 2008

In the movie Die Hard: With a Vengeance, John (Bruce Willis) and Zeus (Samuel Jackson) are having a little problem with jugs. Simon, the bad guy on the mobile, is instructing them on how to defuse the bomb:

On the fountain there should be 2 jugs, do you see them? A 5-gallon and a 3-gallon. Fill one of the jugs with exactly 4 gallons of water and place it on the scale and the timer will stop. You must be precise, one ounce more or less will result in detonation. If you're still alive in 5 minutes, we'll speak.

Do John and Zeus survive? Of course they do, but only after 5 minutes of frantic pouring and repouring.

Can you solve their problem? Too easy? What if you were given 25-gallon jug and 11-gallon jugs, and you had to fill one of the jugs with exactly 7 gallons of water? Not so easy!

There is an ingenious method for tackling these problems. It involves playing billiards on a special parallelogram table:

The dimensions of the table are 5 by 3 units, and the angles are 60 and 120 degrees. We treat the table like a coordinate system, corresponding to the contents of the jugs. For example, (5,2) indicates that the 5-gallon jug is full and the 3-gallon jug contains 2 gallons.

We now place a ball in the lower right corner and shoot along the red path. As the ball travels, we note the coordinates of the points where it bounces: (5,0) (2,3) (2,0) (0, 2) (5,2) (4,3), and so on. When we get to (4,3) the 5-gallon jug contains 4 gallons, and we’re done.

How does this work? Every line corresponds to possible ways of transferring water to and from the jugs, so wherever the red path takes you will also work in reality. Every horizontal line corresponds to completely filling or emptying the 5-gallon jug, without touching the 3-gallon jug. Similarly, every right-sloping line corresponds to completely filling or emptying the 3-gallon jug. Finally, all left-sloping lines correspond to transferring water between the jugs.

Did you have a different solution? Start by placing the ball at the upper left corner, shoot it again at 60 degrees, and see what happens.

Does this always work? Again, what if you are given 25-gallon and 11 gallon jugs, and you must fill one of the jugs with exactly 7-gallons of water? Is this possible to solve, or should you just sit down and wait for the bomb to explode? If you are stumped, e-mail us, and we’ll let you know your fate.

www.qedcat.com

Copyright 2004-∞ All rights reserved.