An elephant is thirsty and needs exactly 4 gallons of water to drink. You have:
- A 5-gallon jug
- A 3-gallon jug
- An unlimited water supply
How can you measure exactly 4 gallons to satisfy the elephant’s thirst?
Solution:
1️⃣ Fill the 3-gallon jug completely and pour it into the 5-gallon jug.
- (5-gallon: 3 gallons, 3-gallon: 0 gallons)
2️⃣ Fill the 3-gallon jug again and pour it into the 5-gallon jug until it’s full.
- This transfers only 2 more gallons (since the 5-gallon jug already has 3 gallons).
- (5-gallon: 5 gallons, 3-gallon: 1 gallon)
3️⃣ Empty the 5-gallon jug completely.
- (5-gallon: 0 gallons, 3-gallon: 1 gallon)
4️⃣ Pour the remaining 1 gallon from the 3-gallon jug into the 5-gallon jug.
- (5-gallon: 1 gallon, 3-gallon: 0 gallons)
5️⃣ Fill the 3-gallon jug completely and pour it into the 5-gallon jug.
- (5-gallon: 4 gallons, 3-gallon: 0 gallons)
Understanding the Elephant Water Jug Riddle


The Elephant Water Jug Riddle is a classic logic puzzle that challenges you to measure exactly 4 gallons of water using only a 5-gallon jug and a 3-gallon jug. But why does this puzzle exist, and how does it work?
Let’s break it down!
The Setup:
- You have two jugs:
- A 5-gallon jug
- A 3-gallon jug
- There are no measurement markings on the jugs.
- You have access to an unlimited water supply.
- Your goal? Give the elephant exactly 4 gallons of water—no more, no less!
Why Is This Puzzle Tricky?
Since neither jug holds exactly 4 gallons, you must use logical steps to measure the water accurately. The challenge is to transfer, fill, and empty the jugs strategically to achieve the precise amount.
Why Is This Puzzle So Popular?
- It teaches problem-solving – This puzzle is used in interviews, brain teasers, and educational settings.
- It’s a classic water jug problem – The concept appears in math, computer science, and even movies like Die Hard with a Vengeance!
- It’s a fun challenge – The solution is simple once you see it, but tricky at first!
Tools You Have: The 5-Gallon & 3-Gallon Jugs
To solve the Elephant Water Jug Riddle, you are given two unmarked jugs and an unlimited water source.
Understanding how these tools work is key to measuring exactly 4 gallons for the thirsty elephant.
The 5-Gallon Jug
- Capacity: Holds up to 5 gallons of water.
- Limitations: No halfway markings—you can only fill, empty, or transfer.
The 3-Gallon Jug
- Capacity: Holds up to 3 gallons of water.
- Limitations: Just like the larger jug, it has no measurement lines.
The Unlimited Water Source
- You can fill and empty the jugs as many times as needed.
- The trick is using logical transfers to measure exactly 4 gallons.
Step-by-Step Solution to the Riddle


Now that we understand the tools—a 5-gallon jug, a 3-gallon jug, and an unlimited water supply—let’s go through the exact steps to measure 4 gallons of water for the thirsty elephant.
Step 1: Fill the 3-Gallon Jug
- Fill the 3-gallon jug to the top.
- (Now: 3-gallon = 3 gallons, 5-gallon = 0 gallons).
Step 2: Transfer Water to the 5-Gallon Jug
- Pour the 3 gallons from the 3-gallon jug into the 5-gallon jug.
- (Now: 3-gallon = 0 gallons, 5-gallon = 3 gallons).
Step 3: Fill the 3-Gallon Jug Again
- Refill the 3-gallon jug completely.
- (Now: 3-gallon = 3 gallons, 5-gallon = 3 gallons).
Step 4: Transfer Water to the 5-Gallon Jug Until Full
- Pour 2 gallons from the 3-gallon jug into the 5-gallon jug, filling it up completely.
- (Now: 3-gallon = 1 gallon, 5-gallon = 5 gallons).
Step 5: Empty the 5-Gallon Jug
- Pour out all the water from the 5-gallon jug.
- (Now: 3-gallon = 1 gallon, 5-gallon = 0 gallons).
Step 6: Transfer the 1 Gallon to the 5-Gallon Jug
- Pour the remaining 1 gallon from the 3-gallon jug into the 5-gallon jug.
- (Now: 3-gallon = 0 gallons, 5-gallon = 1 gallon).
Step 7: Fill the 3-Gallon Jug Again
- Fill the 3-gallon jug completely one last time.
- (Now: 3-gallon = 3 gallons, 5-gallon = 1 gallon).
Step 8: Transfer the Water to the 5-Gallon Jug
- Pour all 3 gallons from the 3-gallon jug into the 5-gallon jug.
- (Now: 3-gallon = 0 gallons, 5-gallon = 4 gallons).
Why This Riddle Is So Popular


The Elephant Water Jug Riddle isn’t just a fun brain teaser—it has been widely used in puzzles, interviews, and even movies! But what makes it so popular? Let’s explore!
It Tests Logical Thinking
This riddle forces you to think step by step and use trial and error to find a solution. It’s a great exercise in problem-solving, critical thinking, and patience.
It’s a Classic Math & Computer Science Puzzle
The puzzle is based on the greatest common divisor (GCD) concept in mathematics. It also helps teach the water jug problem in computer science and algorithm design.
It Appeared in Die Hard with a Vengeance
This exact riddle was featured in the 1995 action movie Die Hard with a Vengeance, where Bruce Willis and Samuel L. Jackson had to solve it to stop a bomb from exploding! This helped make the riddle even more famous.
It’s Used in Job Interviews
Many companies, including Google, Microsoft, and other tech giants, use variations of this puzzle to test a candidate’s logical reasoning and problem-solving skills.
It’s Fun & Challenging!
Even though it’s simple once you know the answer, most people struggle at first. That “Aha!” moment makes it so satisfying when you finally figure it out!
Fun Variations of the Elephant Riddle
The Elephant Water Jug Riddle is just one version of a classic measuring puzzle. If you enjoyed solving it, here are some fun variations to challenge your brain even more!
The 8-Gallon & 3-Gallon Jug Puzzle
Goal: Measure exactly 4 gallons
Tools: One 8-gallon jug and one 3-gallon jug
Challenge: Since the jugs have a larger difference in size, you’ll need to be even more strategic with your transfers!
The 6-Gallon & 9-Gallon Jug Puzzle
Goal: Measure exactly 3 gallons
Tools: One 6-gallon jug and one 9-gallon jug
Challenge: Both jugs are multiples of 3, making this trickier than it seems at first!
The Hourglass Timer Riddle
Goal: Measure exactly 9 minutes
Tools: A 4-minute hourglass and a 7-minute hourglass
Challenge: Flip and time them correctly to track precise minutes—a fun twist on the classic water jug puzzle!
The River Crossing Jug Puzzle
Goal: Measure exactly 2 gallons
Tools: A 5-gallon jug, a 7-gallon jug, and a river instead of a tap!
Challenge: You can only fill the jugs from the river, making the logistics even more interesting!
The Three Cannibals & Three Missionaries Riddle
Goal: Safely transport three missionaries and three cannibals across a river
Tools: A small boat that can carry only two people at a time
Challenge: If the cannibals ever outnumber the missionaries on one side, they’ll eat them! This is another classic logic puzzle similar in complexity to the water jug problem.


