MindYourPuzzleMindYourPuzzle
Insight · ★★☆☆☆ · ~5 min

The Water Pouring Puzzle

A 5-liter jug, a 3-liter jug. Can you measure exactly 4? (Die Hard says yes.)

by MindYourPuzzle

A puzzle made famous by a Hollywood scene (Die Hard 3) — but the real magic is the number theory underneath.

You have two unmarked jugs: one holds exactly 5 liters, the other exactly 3 liters, and an unlimited water supply. You can fill a jug to the top, empty it completely, or pour from one into the other until either the source is empty or the destination is full.

Can you measure out exactly 4 liters — yes or no?

(Answer "yes" or "no".)

Hints