I have a bucket of water that holds 4 gallons of water and another that holds 7 gallons of water. The buckets have no markings. How can I go to the well and bring back exactly 5 gallons of water?

Answer:
  1. Start with empty buckets, and carry them to the well.
  2. (Note that the larger is the 7-gallon bucket, and the smaller is the 4-gallon bucket.)
  3. Fill the 4-gallon bucket with water to the top.
  4. Empty all the water from the 4-gallon bucket into the 7-gallon bucket.
  5. (Note that there is room in the 7-gallon bucket for exactly 3 more gallons.)
  6. Fill the 4-gallon bucket again.
  7. Pour from the 4-gallon bucket into the 7-gallon bucket all the water that will fit, spilling none.
  8. (Note that since there was room for only 3 more gallons in the 7-gallon bucket, you now have 1 gallon left in the 4-gallon bucket.)
  9. Dump out all the water from the 7-gallon bucket. (Pour it back into the well or onto some flowers so it's not wasted.)
  10. Pour the 1 gallon of water that remains in the 4-gallon bucket into the empty 7-gallon bucket.
  11. Refill the 4-gallon bucket completely.
  12. Pour all the 4 gallons from the 4-gallon bucket into the 7-gallon bucket.
  13. (Note that since the 7-gallon bucket had 1 gallon already and you added 4 gallons, you now have 5 gallons of water in the 7-gallon bucket!)
  14. Bring back your 7-gallon bucket that's holding exactly 5 gallons of water. (Bring your 4-gallon bucket back too, in case you want to play again!)
First answer by TedlyW. Last edit by TedlyW. Contributor trust: 499 [recommend contributor recommended]. Question popularity: 1 [recommend question].