Next to it are two empty, unmarked jugs: one holds exactly 5 gallons and the other exactly 3 gallons.
The only thing you can do is pour from one container into another, until the source is empty or the target is full. You cannot estimate, tilt to a mark or spill anything.
How do you end up with exactly 4 gallons in the barrel and 4 gallons in the large jug, and what is the fewest number of pours that does it?
💡 Hint
Track the three amounts as a triple. Progress sometimes means returning liquid to the barrel, so look for small leftover remainders you can build on.
Reveal answer
It takes 7 pours, and the barrel and the large jug each end with 4 gallons.
Step-by-step solution
- Pour from the barrel into the 5-gallon jug until it is full. State (barrel, 5, 3): 3, 5, 0.
- Pour from the 5-gallon jug into the 3-gallon jug until it is full. State: 3, 2, 3.
- Pour the 3-gallon jug back into the barrel. State: 6, 2, 0.
- Pour the 2 gallons from the 5-gallon jug into the 3-gallon jug. State: 6, 0, 2.
- Fill the 5-gallon jug from the barrel. State: 1, 5, 2.
- Top up the 3-gallon jug from the 5-gallon jug. It needs only 1 more gallon. State: 1, 4, 3.
- Pour the 3-gallon jug back into the barrel. State: 4, 4, 0. Done in 7 pours. A search of every reachable position confirms that 7 is the minimum, and that no other 7-pour route exists.
Why it fools people
This puzzle fools people because the progress looks like it goes backward. To reach 4 you must first pour cider back into the barrel, which feels like undoing your work. The solution depends on tiny amounts, a leftover 2 gallons and a leftover 1 gallon, that appear only because the jug sizes do not divide evenly. Once you see that every pour creates a new remainder, the route is just bookkeeping.
Did you get it?
About This Puzzle
Every October, a small orchard in upstate New York sells fresh-pressed cider from a wooden stand by the road. Two neighbors arrive at closing time and agree to share what is left in the big barrel. There is only one problem: nobody brought a measuring cup. All the stand owner has is the barrel and two plain jugs, with no marks on any of them. This is a member of the water jug family, a type of puzzle that rewards patience more than cleverness. Nothing here is a trick of wording, and the only tool you need is careful bookkeeping. Grab a pencil.
How to Think About It
Write the state as three numbers: how much is in the barrel, the 5-gallon jug and the 3-gallon jug. You start at 8, 0, 0 and want 4, 4, 0. Every pour is forced to end in one of two ways, either the source empties or the target fills, so the amount that moves is never a choice. That makes the puzzle a small map of positions rather than an open-ended search. Keep a list of positions you have already visited, so you never walk in circles. When two routes seem equally promising, count the pours before committing to either.
Common Traps
The most common mistake is to fill the 5-gallon jug first and then keep pouring the same way, because the first pour feels obviously right. It is right, but the second pour is where people stall. Another trap is to wander through positions you have already visited, which makes the puzzle feel much bigger than it is. Others try to pour half of something, as if an unmarked jug could be tipped to a fair line. Finally, some solvers find a working sequence and stop, never checking whether a shorter one exists. The question asks for the fewest pours, so a correct but long route is only half an answer.
Where This Puzzle Comes From
Water jug puzzles are a very old family in recreational mathematics, and versions with a few containers of different sizes appear in puzzle collections from many centuries. The 8, 5 and 3 version is one of the best known. Computer scientists use them to teach state space search: list every position and look for the shortest path. A famous movie scene even used a water jug problem as a test. This retelling uses an original orchard setting.
Try This Variation
A bigger barrel now holds 10 gallons, and the two jugs hold 7 and 3 gallons. The rules are the same. How can you end with 5 gallons in the barrel and 5 gallons in the 7-gallon jug, and what is the fewest number of pours?
Show the answer to the variation
It takes 9 pours. One shortest route, shown as (barrel, 7, 3): 3,7,0 then 3,4,3 then 6,4,0 then 6,1,3 then 9,1,0 then 9,0,1 then 2,7,1 then 2,5,3 then 5,5,0. Nine pours is the minimum, because the larger jug sizes leave smaller usable remainders at each step.
