You have a 3-gallon jug and a 5-gallon jug. Your task is to measure out exactly 4 gallons of water using these jugs. You can fill, empty, and transfer water between the jugs as much as you want, but you can’t pour water into any other container.
How can you measure out exactly 4 gallons of water using only these two jugs?
Here is a step-by-step solution to measure out exactly 4 gallons of water using a 3-gallon jug and a 5-gallon jug:
1. Fill the 3-gallon jug completely with water.
2. Pour the water from the 3-gallon jug into the 5-gallon jug.
3. Fill the 3-gallon jug completely with water again.
4. Pour the water from the 3-gallon jug into the 5-gallon jug until the 5-gallon jug is full (it should have 2 gallons of water in it now).
5. You should now have 1 gallon of water left in the 3-gallon jug. Empty the 5-gallon jug completely.
6. Pour the remaining 1 gallon of water from the 3-gallon jug into the 5-gallon jug.
7. Fill the 3-gallon jug completely with water again.
8. Pour as much water as you can from the 3-gallon jug into the 5-gallon jug until it is full. You should have 4 gallons of water in the 5-gallon jug now.
Thus, you have measured out exactly 4 gallons of water using only a 3-gallon jug and a 5-gallon jug.