Henry Ernest Dudeney/Modern Puzzles/185 - Prohibition Again/Solution

by : $185$

 * Prohibition Again
 * Let us now try to discover the fewest possible manipulations under the same conditions as in the last puzzle,
 * except that we may now pour back into the barrel.

Solution
Perform the transactions according to the following:


 * $\begin {array} {r|c|c|c} & \text {$7$-quart} & \text {$5$-quart} & \text {Barrel} \\ \hline

& 0 & 0 & 120 \\ (1): & 7 & 0 & 113 \\ (2): & 7 & 5 & 108 \\ (2): & 7 & 5 & 0 \\ (4): & 7 & 0 & 5 \\ (5): & 2 & 5 & 5 \\ (6): & 2 & 0 & 10 \\ (7): & 0 & 2 & 10 \\ (8): & 7 & 2 & 3 \\ (9): & 4 & 5 & 3 \\ (10): & 4 & 0 & 8 \\ (11): & 0 & 4 & 8 \\ (12): & 7 & 4 & 1 \\ (13): & 6 & 5 & 1 \\ (14): & 6 & 0 & 1 \\ (15): & 1 & 5 & 1 \\ (16): & 1 & 0 & 1 \\ (17): & 1 & 1 & 0 \\ \end {array}$

This is a total of $17$ transactions.