1. Fill the 5 gallon jug - empty 3 gallons into the 3 gallon jug, leaving 2 gallons in the 5 gallon jug and the 3 gallon jug full
2. Empty the 3 gallon jug, leaving 2 gallons in the 5 gallon jug and the 3 gallon jug empty
3. Transfer the 2 gallons from the 5 gallon jug to the 3 gallon jug, leaving 2 gallons in the 3 gallon jug and the 5 gallon jug empty
4. Fill the 5 gallon jug, leaving the 5 gallon jug full and 2 gallons in the 3 gallon jug
5. Transfer 1 gallon from the 5 gallon jug to the 3 gallon jug, leaving 4 gallons in the 5 gallon jug and the 3 gallon jug full
6. Empty the 3 gallon jug, the 5 gallon jug has 4 gallons QED