Water-Jars Problem (Properties of using 2 Jars for the problem)

In the film Die Hard 3, the protagonists have been presented with a problem of how to fill a water can with exactly 4L using a 3L and a 5L tank with an unlimited supply of water [3]. Although the problem, increased in popularity with the film the problem has been around for a while in the psychology area. The problem is known as the water-jar problem and is normally applied with 3 jars [1][2]. However, for the purpose of this article the film line of using 2 water jars/cans is taken into consideration.

When looking at the problem with 2 jars from a Mathematical perspective 2 main questions arise:

• Are there any properties that define the problem?
• Is it possible to generate all positive numbers lower than the largest value using any combination of 2 numbers?

The answer to these questions is yes and no. The properties that the problem follows are:

• For any 2 numbers, $s$ (for small jar) and $l$ (for large jar)
$$\forall s,l \in\mathbb{N}\ | \ 1
• If $s$ and $l$ have a common factor, which is not 1, or $l$ is a multiple of $s$, then the multiples of the smallest common factor can be achieved
• Otherwise, all numbers from 1 up to $l$ can be achieved.

“For any 2 numbers where n­2 ÷ n1 leaves a remainder, then using combinations of adding and subtracting water across the 2 jars, all whole numbers (natural numbers) less than n2 can be achieved”

Why having a remaining water is important? The remaining water in any of the jars, as long as the other jar is empty will shift the value that can be achieved through the moving of water across jars.

Let’s take an example. Assuming we are provided with 2 jars, one 4 litres and the other is 15 litres.

Starting from the first point, the values 4 and 15 have no common factors. This means that all values less than 15 should be possible. Let’s have a look.

At the end of all the movements all possible volumes have been achieved since once the 4L jar is emptied the values will start to repeat. Highlighting all the different volumes obtained in the 15L and putting them in sorting order, one can see that all values lower than 15 has been obtained.

The table below shows the values obtained in ascending order and the sequence they were achieved

Another interesting observation is that the last cycle will always end up producing the multiples of the smallest jar. Why not try it out with a different combination and see the pattern?

The application of the aforementioned scope and properties, raise other questions to the curious mind:

• If more jars are added what properties can be observed? Is there a generic pattern?
• Looking at the sequences the different capacities are obtained. Do the values follow a pattern?
• Can the same properties be generalized to jars that hold half a litre, or rational values? Like using a 3.25L, or 5.5L jars.
• If the supply of water is limited:
• Are there evaluation properties that can optimise the way to arrive to needed values based on their characteristics?
• What is the minimum level of water needed based on the jars’ capacity?

References:

1. Oxford Reference. 2022. water-jar problem. [online] Available at: <https://www.oxfordreference.com/view/10.1093/oi/authority.20110803121257782> [Accessed 15 January 2022].
2. Theburningofrome.com. 2022. What is the water jar problem? – Theburningofrome.com. [online] Available at: <https://www.theburningofrome.com/blog/what-is-the-water-jar-problem/> [Accessed 15 January 2022].
3. Wikihow.com. 2022. How to Solve the Water Jug Riddle from Die Hard 3 (with Pictures). [online] Available at: <https://www.wikihow.com/Solve-the-Water-Jug-Riddle-from-Die-Hard-3> [Accessed 15 January 2022].