AH HA! You decided to be lazy and just look up the answer!
Well, here it is!

The answer's not that difficult. It just requires a bit of thinking. Don't you remember seeing this problem in "Diehard" (w/Bruce Willis and Samuel L. Jackson)? Read slowly and carefully. Well, first you fill up the 5-gallon jug. Then pour it into the 3 gallon jug. Empty the 3-gallon jug. Now you have 2 gallons in the 5-gallon jug. Pour the remaining water from the 5-gallon into the 3-gallon. So now you have the 2 gallons of water in the 3-gallon jug. The 5-gallon is empty. Fill up the 5-gallon. Pour the 5-gallon into the 3-gallon (which already has 2 gallons in it). What you basically do is take out 1 gallon from the 5-gallon (5-1=4). So now the remaining water in the 5-gallon jug is exactly 4-gallons! Did you get it?
Back to Main