Two Jugs: 5 L and 7 L
Read the puzzle
There is a 5 L jug, a 7 L jug, a tap and a drain. Filling a jug from the tap, emptying a jug down the drain, or pouring one jug into the other each counts as 1 move. A pour stops when one jug is empty or the other is full. The jugs have no markings. What is the fewest number of moves to end with exactly 6 L in the 7 L jug?
Filling, emptying or pouring a jug counts as 1 move each. Fewest moves to get exactly 6 L in the 7 L jug?
Always fill the 7 L jug and pour it into the 5 L jug.
10 moves
Fill 7, pour into 5, empty 5, pour 2 L over, fill 7, top up 5, empty 5, pour 4 L over, fill 7, top up 5.
How to solve it
Write the state as (5 L jug, 7 L jug). The plan is to keep filling the 7 L jug and pouring it into the 5 L jug, so each round leaves 2 L more behind.
Round 1: fill 7 (0, 7), pour (5, 2), empty 5 (0, 2), pour the 2 L over (2, 0). That is 4 moves.
Round 2: fill 7 (2, 7), top up the 5 L jug with 3 L (5, 4), empty 5 (0, 4), pour the 4 L over (4, 0). That is 4 more moves, 8 so far.
Finish: fill 7 (4, 7), then top up the 5 L jug with just 1 L (5, 6). That is 10 moves, and 7 - 1 = 6 L stays in the big jug.
The usual wrong answer is 12, from starting with the 5 L jug: fill 5, pour, fill 5, pour (3 L left), empty 7, pour, fill 5, pour (1 L left), empty 7, pour, fill 5, pour gives 6 L but takes 12 moves. Some people also give a smaller number by forgetting that every empty and every pour counts.
The answer is 10 moves. Quick check: the amounts left behind go 2, 4, 6, rising by 7 - 5 = 2 each round.
Learn the method: How to Solve Water Jug Puzzles, Step by Step