Can you solve the water jug puzzle?
Summary
Degree programs
Research themes
This activity is part of our Science Lab series. Check out the ANU Science Lab for more experiments! In this activity, you will solve a classic water jug puzzle using paper cups and marbles. You will investigate number patterns and discover how mathematics can be used to measure exact quantities using only containers of fixed sizes. Watch the video above to see how its done.
Materials
For this activity, you will need:
- 2 paper cups or containers
- A pen or marker
- 15 to 20 marbles, beads or small counters
For this activity, each marble represents 1 litre of water.
How to solve the water jug puzzle
Step 1: Set up the puzzle
- Label one paper cup with 5 to represent a 5-litre jug.
- Label the second paper cup with 7 to represent a 7-litre jug.
- Gather your marbles or counters.
The goal is to end up with exactly 1 litre remaining in the 5-litre jug.
Step 2: Work through the solution
- Place 5 marbles into the 5-litre cup.
- Pour all 5 marbles into the 7-litre cup.
- Place 5 new marbles into the 5-litre cup.
- Pour marbles from the 5-litre cup into the 7-litre cup until the 7-litre cup is full. Since the 7-litre cup already contains 5 marbles, only 2 more marbles can be added. This leaves 3 marbles in the 5-litre cup.
- Empty the 7-litre cup.
- Pour the 3 marbles from the 5-litre cup into the empty 7-litre cup.
- Fill the 5-litre cup again with 5 marbles.
- Pour marbles from the 5-litre cup into the 7-litre cup until it is full. The 7-litre cup already contains 3 marbles, so it only needs 4 more marbles.
- The 5-litre cup now contains exactly 1 marble, representing 1 litre.
Step 3: Check your result
- Count the marbles remaining in the 5-litre cup.
- Double check that exactly 1 marble is left.
- Try to find a different sequence of steps that produces the same result.
How does it work?
This puzzle is an example of number theory in action.
Every step in the puzzle involves adding or subtracting multiples of the two container sizes. By repeatedly filling, emptying and transferring marbles, you create different combinations of 5 and 7.
A key idea is the greatest common divisor (GCD), which is the largest number that divides both container sizes exactly.
Because 5 and 7 share no common factors other than 1, their greatest common divisor is 1. This means it is possible to measure any whole-number quantity up to the capacity of the larger container.
For example:
- Using 5-litre and 7-litre containers, it is possible to measure 1 litre.
- Using 6-litre and 8-litre containers, the greatest common divisor is 2.
- With 6-litre and 8-litre containers, only even quantities can be measured.
- Measuring exactly 1 litre would be impossible because 1 is not a multiple of 2.
Mathematicians describe this relationship using Bézout's identity, which explains why certain quantities can be measured and others cannot.
Science fair project: Take it further
Once you have solved the water jug puzzle, investigate how different container sizes affect the possible solutions.
- Try starting by filling the 7-litre container instead of the 5-litre container. Can you still measure 1 litre?
- Test different container sizes, such as 4 litres and 9 litres. Which quantities can be measured?
- Compare container pairs that share a common factor, such as 6 litres and 9 litres. Which measurements are impossible?
- Add a third container, such as 3 litres, 5 litres and 8 litres. Can you find new ways to measure exact quantities?
- Create a table showing different container sizes and the quantities that can be measured with each pair.
- Investigate the relationship between the greatest common divisor and the quantities that can be measured. Can you identify a mathematical rule?
Enjoyed this experiment? Explore more hands-on activities on the Science Lab ANU YouTube channel.