393. By the Stream. There is a general opinion that puzzles requiring the measurement of a certain amount of liquid can only be solved by a series of trials, but in such cases, general formulas for solutions can be found. Taking advantage of an unexpected leisure, I examined this question more closely. As a result, some very interesting things were discovered. Let's consider, for example, the simplest case, where a person comes to a stream with only two vessels and wants to measure a certain amount of water. If we are dealing with, say, a barrel of wine, we may encounter various complications related to whether the barrel is empty or full, whether we know its capacity and contents, whether the loss of wine is allowed, and whether it is possible to pour the wine back into the barrel. By the stream, all these complications disappear. Perhaps the problem has simplified to such an extent that it makes no sense to talk about it as a puzzle at all? Let's see.

A person comes to a stream with two vessels of 15 and 16 liters capacity. How can he measure exactly 8 liters of water in the fewest number of operations? Filling a vessel, emptying it, or pouring water from one vessel to another counts as one operation.

This puzzle is not difficult, but I think the reader will find it quite entertaining and instructive. It goes without saying that no tricks, such as marks on the vessels or tilting them, are allowed.
393.

\(A\)

\(B\)

\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline 15 l & 16 l & \(15 \pi\) & 16 l & 15 l & 16 l & 15 l & 16 l \\
\hline 0 & \(16^{*}\) & 15 & \(5^{*}\) & \(15^{*}\) & 0 & 0 & 11 \\
\hline 15 & \(1^{*}\) & 0 & 5 & 0 & 15 & 15 & 11 \\
\hline 0 & 1 & 5 & 0 & 15 & 15 & \(10^{*}\) & 16 \\
\hline 1 & 0 & 5 & 16 & \(14^{*}\) & 16 & 10 & 0 \\
\hline 1 & 16 & 15 & \(6^{*}\) & 14 & 0 & 0 & 10 \\
\hline 15 & \(2^{*}\) & 0 & 6 & 0 & 14 & 15 & 10 \\
\hline 0 & 2 & 6 & 0 & 15 & 14 & \(9^{*}\) & 16 \\
\hline 2 & 0 & 6 & 16 & \(13^{*}\) & 16 & 9 & 0 \\
\hline 2 & 16 & 15 & \(7^{*}\) & 13 & 0 & 0 & 9 \\
\hline 15 & \(3^{*}\) & 0 & 7 & 0 & 13 & 15 & 9 \\
\hline 0 & 3 & 7 & 0 & 15 & 13 & \(8^{*}\) & 16 \\
\hline 3 & 0 & 7 & 16 & \(12^{*}\) & 16 & & \\
\hline 3 & 16 & 15 & \(8^{*}\) & 12 & 0 & & \\
\hline 15 & \(4^{*}\) & 0 & 8 & 0 & 12 & & \\
\hline 0 & 4 & 8 & 0 & 15 & 12 & & \\
\hline 4 & 0 & 8 & 16 & \(11^{*}\) & 16 & & \\
\hline & 16 & & & 11 & & & \\
\hline
\end{tabular}

Each row in the column represents an operation. Thus, in the case of \(A\), we first fill the 16-liter container, then pour 15 liters into another container, leaving 1 liter; then, by emptying the 15-liter container, we pour the 1 liter from the 16-liter container into it, and so on.

The asterisks show how we can sequentially measure 1, 2, 3, 4 liters, and so on. We can also proceed differently, as shown in case \(B\): first fill the 15-liter container, and then sequentially measure 14, 13, 12, 11 liters, and so on. Continuing the "strategy" of \(A\), we get the pouring scheme \(B\) in reverse order. From this, it is clear that to measure from 1 to 7 liters, we should use method \(A\), and from 8 to 14 liters, method \(B\). Using method \(A\), we can measure 8 liters in 30 operations, and using method \(B\) in only 28, which is the correct answer.

Surprisingly, using any two coprime measures (i.e., measures that do not have common divisors, such as 15 and 16), we can measure any integer number of liters from 1 to the largest measure. Using 4-liter and 6-liter containers (each divisible by 2), we can only measure 2, 4, and 6 liters. With 3-liter and 9-liter containers, we can only measure 3, 6, and 9 liters. In our table, the measurable volumes are in the correct sequence. However, if we take 9-liter and 16-liter containers and apply method \(A\), we get 6, 14, 5, 12, 3 liters, and so on, with a cyclic difference of 7 (16 - 9 = 7). In other words, by adding 7 to 14 and subtracting 16, we get 5, and by adding 7 to 12 and subtracting 16, we get 3, and so on.

[For a good method of solving such puzzles using isometric graph paper, see my note in Scientific American, September 1963, and for further discussion of this method, see T. H. O'Beirne's book "Puzzles and Paradoxes" (Oxford University Press, 1965). - M. G.]