Two containers, a bucket and a basin, have volumes of 3 and 5 liters, respectively. By removing water from a lake, how can we leave the basin with exactly 4 liters of water using only these two containers?

![](https://cdn.mathpix.com/cropped/2024_05_01_09dbad5281c800d666d6g-03.jpg?height=214&width=915&top_left_y=596&top_left_x=650)

#
Solution

At any time, we can indicate the amounts of water in the two containers through a pair $(a, b)$, where $a$ indicates the number of liters in the bucket and $b$ in the basin. At the beginning, when both containers are empty, we have the pair $(0,0)$. At the stage, we want to obtain the pair $(a, 4)$, which is when the measurement is complete. Considering only non-negative integer values for $a$ and $b$, as there are 4 options for $a$ and 6 options for $b$, we have a total of $4 \cdot 6=24$ possible configurations to analyze. We can represent these configurations by points as indicated in the following drawing:

![](https://cdn.mathpix.com/cropped/2024_05_01_09dbad5281c800d666d6g-03.jpg?height=582&width=769&top_left_y=1475&top_left_x=731)

In this drawing, we can connect two points when there is some operation with the containers that transforms the amounts of water from one of these points to the other. For example, we can connect $(0,0)$ to the point $(0,5)$, as this means filling the basin and leaving the bucket empty. We also connect a point associated with $(a, 0)$ to the point associated with $(0, a)$, as this means transferring all the water from the bucket to the basin, which is empty. The previous drawing shows a path, starting from $(0,0)$ to $(3,4)$, which is the moment we stop because we have obtained the exact amount of 4 liters in the basin.

These operations can be summarized in the following table:

| $a$ | 0 | 0 | 3 | 0 | 2 | 2 | 3 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| $b$ | 0 | 5 | 2 | 2 | 0 | 5 | 4 |

Note: A very useful strategy in problems involving changes in configurations is the graphical representation of transitions through points and arrows. These representations are studied in Graph Theory. Another example of a similar problem:

A milkman has a container with a capacity of 12 liters. He needs to deliver exactly 6 liters to a customer who has two empty containers, one of 8 liters and the other of 5 liters. How can the milkman leave exactly 6 liters in the larger container of the customer and keep the other 6 liters with himself?

The table that represents the movements in the graph associated with this situation until obtaining the 6 liters in the customer's container is:

| 12-liter container | 12 | 4 | 4 | 9 | 9 | 1 | 1 | 6 |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 8-liter container | 0 | 8 | 3 | 3 | 0 | 8 | 6 | 6 |
| 5-liter container | 0 | 0 | 5 | 0 | 3 | 3 | 5 | 0 |