Given a 5-liter jug, a 3-liter jug, and an unlimited supply of water, how do you measure out exactly 4 liters?
In her book In Code: A Mathematical Journey, Sarah Flannery gives this classic brainteaser as an example of the sorts of playful puzzles that her father, a mathematics lecturer at the Cork Institute of Technology in Ireland, often offered to her and her four younger brothers at dinnertime and other occasions. “My dad gave it to me when I was quite young, probably about 5 years old,” she recounts.