Carson Sasser
-- generating more background noise

Solve the Jug Problem

Here's a simple problem to exercise your mind. You have two jugs. One holds three gallons and the other holds five gallons. There are no markings on the jugs except a full mark. Your task is to put precisely four gallons of water in the five-gallon jug using only the two jugs. You have an unlimited supply of water available. Describe how you would accomplish this in a comment. There are at least two ways to do it. Don't cheat by looking it up on the internet.

I got this from an old movie but different forms of this problem have been around for ages. The characters in the movie solved the problem but didn't say how -- at least not in the version I saw. You get extra credit if you can name the movie.


Comments

05 Jan 07, 5:34pm

Without spoiling the solution, it was DIe Hard 3, right?

05 Jan 07, 5:40pm

Could be, but the version I saw was billed as Diehard with a Vengeance. Bruce Willis and Samuel Jackson had to solve the problem to prevent a bomb from exploding.

05 Jan 07, 8:30pm

They also solved "As I was going to St Ives...." Yeah, I got the name wrong.

mizar
08 Jan 07, 5:39pm

1. Fill the 5-gal jug. 2. Pour from the 5-gal jug into the 3-gal jug until it's full. That leaves 2 gal in the 5-gal jug. 3. Dump the water out of the 3-gal jug. 4. Pour the 2 gal that was left in the 5-gal jug into the 3-gal jug. 5. Fill the 5-gal jug. 6. Pour from the 5-gal jug into the 3-gal jug until it's full. Since there was already 2 gal in the 3-gal jug, filling it will mean you poured 1 gal ... leaving 4 gal in the 5-gal jug.

09 Jan 07, 8:42am

Congratulations mizar. Below is another solution. It takes more steps but uses less water.

1. Fill the 3-gallon jug.

2. Empty the 3-gallon jug into the 5-gallon jug.

3. Fill the 3-gallon jug again.

4. Finish filling the 5-gallon jug by pouring from the 3-gallon jug. That leaves 1 gallon in the 3-gallon jug.

5. Dump the water from the 5-gallon jug.

6. Pour the 1 gallon from the 3-gallon jug into the 5-gallon jug.

7. Fill the 3-gallon jug again.

8. Empty the 3-gallon jug into the 5-gallon jug.

9. The 5-gallon jug now contains 4 gallons.

Make a comment:

Recent Articles
Recent Comments on Articles
Recent Comments on Home Page Remarks
Blogs that Link to Me
Other Blogs
Blogs About Blogging