Using only a jug that can hold 5 gallons of water and another jug that can hold 3 gallons of water, how can you come up with EXACTLY 4 gallons of water?
Note: This problem comes from the movie Die Hard With a Vengance.
Pour the 3 into the 5.
Fill it up again then pour 2 gallons inot the 5 leaving 1 in the 3.
Throw away the water in the 5, then add the remaining water from the 3 (1gallon), fill the 3 again and add that too:
You have 4 gallons in the 5
Originally posted by kbaumen How can you dump exactly three? Your solution isn't very precise. Take a look above your post.
EDIT: Sorry, my mistake. I thought that your idea is to pour those 3 gallons out of the 5 gallon jug.
The idea is to pour 3 gallons out of the 5 gallon jug, but to measure, you pour into the 3 gallon jug. Hence the next line, where the 3 gallons is dumped.