How to measure exactly 4 gallon of water from 3 gallon and 5 gallon jars, Given, you have unlimited water supply from a running tap.
It was also solved by Bruce Willis in one of his Die Hard movie to stop a bomb.
See Solution: How to measure 4 gallon water from 3 gallon and 5 gallon jarSolution 1:
- Fill 3 gallon jar with water.
- Pour all its water into 5 gallon jar.
- Fill 3 gallon jar again.
- Pour its water into 5 gallon jar untill it is full. Now you will have exactly 1 gallon water remaining in 3 gallon jar.
- Empty 5 gallon jar, pour 1 gallon water from 3 gallon jar into it. Now 5 gallon jar has exactly 1 gallon of water.
- Fill 3 gallon jar again and pour all its water into 5 gallon jar, thus 5 gallon jar will have exactly 4 gallon of water.
Solution 2:
- Fill 5 gallon jar.
- Pour all its water to 3 gallon jar, thus leaving exactly 2 gallon water in 5 gallon jar.
- Empty 3 gallon jar and pour all of 5 gallon jar water into it, thus now 3 gallon jar will have exactly 2 gallon of water.
- Fill 5 gallon jar again and pour its water to 3 gallon jar until that is full. So exactly 4 gallon water will remain in 5 gallon jar.