Problem 142 medium

Four gallons from a 3 and a 5

You have an unlimited supply of water, an empty 3-gallon jug and an empty 5-gallon jug, neither with any markings. One step is one of:

  • fill a jug completely;
  • empty a jug completely;
  • pour from one jug into the other until the first is empty or the second is full.

What is the smallest number of steps after which one of the jugs holds exactly 4 gallons?

Answer

Fractions, decimals with at least 3 significant digits, and expressions such as sqrt(2)/2, e^-1 or pi/4.

Hints 0/2

h

Solution

s Shown after a correct answer. Revealing it first marks the problem as seen, not solved.