- First, fill the 3-liter container to the brim.
- Pour the 3 liters of water into the 5-liter container.
- Fill the 3-liter container again.
- Pour water from the 3-liter container into the 5-liter container until it is filled to the brim. This should leave you with 1 liter of water in the 3-liter container.
- Empty out the 5-liter container, then pour the 1 liter of water into it from the 3-liter container.
- Fill the 3-liter container once more, then pour the water from both containers into the third container.

- Fill the 5-liter container.
- Fill the 3-liter container from the 5-liter container, leaving 2 liters.
- Empty the 3-liter container. Then, pour the remaining 2 liters from the 5- to the 3-liter container.
- Refill the 5-liter, then fill the 3-liter from the 5-liter container. Leaving 4 liters in the 5-liter container.

- Fill the 5-liter container, then place one part of the bottom down, and tilt it until the water level makes a straight line from the upper edge of the bottom to the bottom edge of the lip.
- Do the same thing with the 3-liter container, and pour it into the 5-liter container.
- 2.5 + 1.5 = 4

*x*and

*y*that satisfy 3

*x*−5

*y*=4; then fill the 3-liter

*x*times, pouring it into the 5-liter when full, and emptying the 5-liter when it's full (which you'll do

*y*times). The solution is

*x*=3 and

*y*=1. The alternate solution up there is the dual formulation, 5

*x*−3

*y*=4 (

*x*=2,

*y*=2). From here, two details present themselves: one, that it's easily adaptable to other values other than 3 and 5, and two, that a solution exists only if the target value is either a factor or a multiple of the highest common factor of the container sizes (e.g. you can't get 4 liters from 6- and 3-liter containers).

## Examples

Alternate Reality Game-
*Perplex City*used this one on a card.

- In the movie
*Die Hard with a Vengeance,*the two main characters must solve this type of puzzle in order to disarm a bomb near a public fountain.

In the original script, the bomb was a Chekhov's Gun, as the movie would end with McClane planting the bomb on the bad guy's helicopter, and upon discovery one of them asks if anyone has a four gallon jug (in the final script the bomb was used for something else entirely without the puzzle being brought up again).

- This puzzle appears in
*Knights of the Old Republic*on Manaan, and solving it is a prerequisite for the "good" ending on that planet. - This puzzle and several variants appear in the
*Professor Layton*series. - A slight variant with different values in
*Zork Zero*, a game almost entirely composed of stock puzzles. -
*The Castle of Dr. Brain*has a form of this with its hourglass puzzle. Measure 40 seconds with a 25 and 15-second hourglass. - A variation of this puzzle occurs in
*Fatal Hearts*, where you need ⅔ cup of flour but have only an 800ml cup and a 100ml cup. The puzzle's not too hard if you're good at conversions. - An apparently more complex version of this classic puzzle appears at the end of
*Sherlock Holmes Versus Arsène Lupin*, where you have to measure exactly 478cc of black powder with only 250cc, 80cc and 12cc containers at your disposal. I say apparently only, because 1×250 + 19×12=478, so you don't actually have to use the pour-bigger-into-smaller subtraction trick at all to solve it.- It
*can*be done much faster with the pour-bigger-into-smaller trick, though: 1x250 + 3x80 − 1x12=478. - The original version also appears in "Sherlock Holmes And The Mysteryof The Mummy" as well as "Sherlock Holmes And The Mysteryofthe Persian Carpet" (Which borrowed every other puzzle too)

- It
- Appears in
*RuneScape*, among other Stock Puzzles. - Appears in
*Phantasmat*as an unusual method of switching on a generator. - Done with lava in the last chapter of the Wii
*Carmen Sandiego*game. - In
*Sir Basil Pike Public School*, if you pick the boy's path, you must solve this puzzle for the janitor before heading to the tennis court. (The girl's path has a Knights and Knaves puzzle instead.) - The final level of
*Tomb Raider: The Last Revelation*contains this exact puzzle and two variants.