The Water Jug puzzle: a logical solution
- Physics Core

- 50 minutes ago
- 3 min read
Many readers will remember the iconic scene from Die Hard with a Vengeance, where John McClane is given only minutes to solve the Water Jug puzzle avert a disaster. As expected, the supercop passed the test with flying colours, demonstrating remarkable logical skills. The film brought this classical problem into popular culture, with numerous websites recounting the steps McClane followed. However, a logical puzzle warrants more than a simple rundown of moves. In this article, we take a logical approach to derive a systematic solution and even predict that multiple solutions exist.
Problem. You have an unlimited supply of water and two measuring capacities: a 5-gallon jug and a 3-gallon jug. Using these jugs, you must obtain exactly 4 gallons of water in one of them.

Analysis. We start by formalizing the given conditions and objectives to identify possible actions.
Givens: a 5-gallon jug (5G), a 3-gallon jug (3G), and an unlimited water supply
Objective: to fill one of the jugs with exactly 4 gallons of water
Actions: pour water from one jug into the other, emptying and refilling each completely
A key observation is that, by pouring water from one jug to another, we exchange the water volume in one jug for the equivalent volume of empty space in the other. This symmetry suggests that puzzles of this type must have two reversible solutions. Assuming the 3G jug can't hold 4 gallons of water, we conclude that the holder must be the 5G jug. Now, mathematically, the solution rests on a simple arithmetic relationship between the jug sizes, 5 gallons and 3 gallons:
4 gallons = 5 gallons −1 gallon = 3 gallons + 1 gallon,
This logical approach immediately points to two reversible solutions:
Removing 1 gallon of water from the full 5G, for which we need to create 1 gallon of empty space in the 3G, or
Adding 3 gallons plus 1 gallon of water to the empty 5G, for which we need to create 1 gallon of water in the 3G.
Solution 1 (used in the film)
We aim to create 1 gallon of unused capacity in the 3G. To achieve this, we must fill the 3G with 2 gallons of water. Playing with the given volumes of 3 gallons and 5 gallons, we get:
2 gallons = 5 gallons − 3 gallons
Assigning "+" to the water gallons and "-" to the empty gallons, we determine the following operations. We fill the 5G with water (+5) and transfer 3 gallons into the empty 3G (-3). This leaves 5G with 2 gallons of water (+2) we need. The rest is simple. We refill the 5G, dump 1 gallon into the 3G to bring it up to capacity, leaving the 5G with 4 gallons of water. The task is complete.
Solution 2 (not featured in the film)
We aim to create 1 gallon of water in the 3G. To this, we must again play with the given volumes of 3 and 5 gallons:
1 gallon = 3 gallons + 3 gallons − 5 gallons
Following the equation, we fill the 3G with water (+3), transfer its content to the empty 5G (-5), refill the 3G (+3), and add 2 gallons to the 5G to bring it to capacity. This leaves the 3G with 1 gallon of water we need. To complete the task, we transfer 1 gallon to the empty 5G, refill the 3G, and add another 3 gallons to the 5G. This leaves the 5G with 4 gallons of water. The puzzle is solved.
Conclusion. The enduring appeal of this puzzle lies in its unique blend of mathematical structure and cinematic drama. Popular culture often presents it as a clever trick or a feat of quick thinking. Yet its true value emerges when we recognise the underlying logic that can turn a seemingly impossible task into a predictable outcome.

Comments