Solution

The Twelve-Litre Cask

Show the problem again

A 12-litre cask is full of wine. You also have an empty 7-litre jug and an empty 5-litre jug. None of the vessels has markings, and nothing can be spilled or added. A move is one pouring from one vessel into another, continuing until the source is empty or the destination is full. What is the minimum number of moves needed to have exactly 6 litres in the cask and 6 litres in the 7-litre jug?

Worked solution

The answer is 11 moves. Writing the contents as (cask, 7-jug, 5-jug), one shortest route is (12,0,0) → (5,7,0) → (5,2,5) → (10,2,0) → (10,0,2) → (3,7,2) → (3,4,5) → (8,4,0) → (8,0,4) → (1,7,4) → (1,6,5) → (6,6,0). A breadth-first search over all reachable states shows that none of the earlier layers (0 to 10 moves) contains (6,6,0), so 11 is optimal.

Source: Classic three-vessel division puzzle in the tradition of Tartaglia and Bachet; no traceable original source for this particular size triple. Statement written for AxiomIQ.