I have for the past couple of years enjoyed reading some about number theory or discrete math – I’m not sure exactly where the dividing line is between these 2 areas. Last night I watched Die Hard with a Vengeance, and there was a scene in it where Bruce and Samuel have to disarm a bomb in the water fountain by measuring 4 gallons of water and placing it on a scale using a 3 gallon and a 5 gallon jug. Somehow they eventually figured this out by pouring water back and forth between the jugs and disarmed the bomb. Very dramatic and a good way for movie stars to solve the problem.
I thought about this and wondered if a mathematician could do it differently. The solution to the problem turns out to be to solve the equation 3*x is congruent to 4 (mod 5). Although such equations can be solved systematically for more complex cases, simple inspection shows the answer to be 3*3 is congruent to 4 (mod 5). Hence, Bruce and Samuel needed to fill the 3 gallon jug 3 times and pour it into the 5 gallon jug, and would end up with 4 gallons in the 5 gallon jug.