Ali has three containers: a 4-liter, a 7-liter, and a 10-liter container. The 10-liter container is full of wine, the other two are empty. Someone wants to buy 5 liters of wine from him. Ali wants to measure out the wine, but only his own containers are available. How can he measure out the wine?

And how can he measure out the wine if he has an 8-liter container instead of a 7-liter container?
a) We solve the first part of the task by trial and error. If we have already measured 1 liter, we are done: adding 4 liters to the 1 liter using the 4-liter jug, we get 5 liters. We can obtain 1 liter as follows: transfer 4 liters from the 10-liter jug to the 7-liter jug, then measure 4 liters in the 10-liter jug and fill the 7-liter jug from the 4 liters. 1 liter of wine will remain in the 4-liter jug.

To this 1 liter, we need to add another 4 liters; therefore, we need to empty the 4-liter jug. Transfer the contents of the 7-liter jug to the 10-liter jug, then transfer the 1 liter of wine to the 7-liter jug. This empties the 4-liter jug, and by adding 4 liters to the 7-liter jug, we get 5 liters. Summarized in a table:

| 10-liter | 10 | 6 | 6 | 2 | 2 | 9 | 9 | 5 | 5 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 7-liter | 0 | 0 | 4 | 4 | 7 | 0 | 1 | 1 | 5 |
| 4-liter | 0 | 4 | 0 | 4 | 1 | 1 | 0 | 4 | 0 |

We can see that we get 5 liters of wine in the 10-liter jug by the seventh transfer.

b) In Ali's country, a new space unit called the "big liter" was introduced: one big liter is exactly two liters. The second part of the task requires Ali to measure out two and a half big liters of wine, using 5-liter, 4-liter, and 2-liter jugs. However, no matter how Ali pours the wine, there will always be an integer number of big liters in each jug: thus, he cannot measure out 5 liters of wine.

Remarks. 1. There are other solutions to the first part of the task, one of which we present in a table immediately:

| 10-liter | 10 | 6 | 0 | 4 | 4 | 8 | 8 | 1 | 1 | 5 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 7-liter | 0 | 0 | 6 | 6 | 2 | 2 | 0 | 7 | 5 | 5 |
| 4-liter | 0 | 4 | 4 | 0 | 4 | 0 | 2 | 2 | 4 | 0 |

2. Let's represent the amount of wine in the three jugs on a grid of equilateral triangles, as shown in the first figure: the content of the 7-liter jug is measured on the $OA$ ray; the content of the 4-liter jug on the $OB$ ray, and we take the intersection of the lines parallel to $OB$ and $OA$ from these points.

![](https://cdn.mathpix.com/cropped/2024_05_02_e27b42324f197155a0ecg-1.jpg?height=477&width=783&top_left_y=1458&top_left_x=649)

For example, the circled point represents the case where there are 3 liters in the 7-liter jug, 2 liters in the 4-liter jug, and $(10-3-2=) 5$ liters in the 10-liter jug. On lines parallel to $OA$, the content of the 4-liter jug is constant; on lines parallel to $OB$, the content of the 7-liter jug is constant; and on lines parallel to the third direction, the content of the 10-liter jug is constant.

Since there is always a non-negative, integer number of liters in each jug, during pouring, we can only reach points inside or on the boundary of the thickly drawn part of the diagram. Moreover, during pouring, one of the jugs always empties or fills up, so the lines representing the pouring consist of broken lines whose breakpoints are on the boundary. The second figure shows the diagrams of the two pouring methods found earlier.
![](https://cdn.mathpix.com/cropped/2024_05_02_e27b42324f197155a0ecg-1.jpg?height=276&width=1006&top_left_y=2358&top_left_x=542)

2. Figure

The lines start from the bottom left corner of the diagram (the 4-liter and 7-liter jugs are empty, and the 10-liter jug is full). This method is almost always useful for any pouring problem.

3. It is easy to verify that in our case, Ali can measure out any integer number of liters.

We recommend the following books to those interested:

Lukács Ernőné-Tarján Rezsóné: Tarkabarka Mathematics, or

J. I. Perelman: Entertaining Geometry.