Water Jug Problem | Puzzles for Interview - Interview Preparation PDF Download

Introduction

Suppose we have two water jugs, one with the capacity of 4 Gallons, and the other with a capacity of 9 Gallons. But, there are no measuring labels on either of the jugs. Can we measure all the quantities from 1G to 9G using these unmarked jugs?

Solution

Yes, we can measure all the quantities from 1G to 9G using these unmarked jugs. Let's see how:

  • Measuring 4G and 9G: We can measure 4G by filling the 4G jug completely, and similarly, we can measure 9G by filling the 9G jug completely.
  • Measuring 5G: Fill the 9G jug fully, then transfer water from the 9G jug to the 4G jug until the 4G jug is full. Now, the 9G jug will have 5 gallons of water, hence measuring 5G.
  • Measuring 1G: Fill the 9G jug to its maximum capacity, then transfer water from the 9G jug to the 4G jug until the 4G jug is full. Empty the 4G jug, and again, transfer water from the 9G jug to the 4G jug until the 4G jug is full. Now, there will be 1G of water left in the 9G jug, hence measuring 1G.
  • Measuring 8G: Fill up the 4G jug and empty it into the 9G jug. Repeat this procedure, and the 9G jug will have 8 gallons of water, hence measuring 8G.
  • Measuring 3G: Fill the 4G jug and empty it into the 9G jug. Repeat this procedure until the 9G jug is full. Now, the 4G jug will have 3G of water, hence measuring 3G.
  • Measuring 7G: Measure 3G as mentioned earlier. Transfer this 3G of water from the 4G jug to the 9G jug. Now, completely fill the 4G jug and transfer water from the 4G jug to the 9G jug until the 9G jug is full. Now, the 9G jug will have 7G of water, hence measuring 7G.
  • Measuring 2G: Measure 7G as mentioned earlier. Transfer the water from the 4G jug to the 9G jug until the 4G jug is empty, and the 9G jug measures 7G. Now, completely fill the 4G jug and transfer water from the 4G jug to the 9G jug until the 9G jug is full. Now, the 4G jug will have 2G of water, hence measuring 2G.
  • Measuring 6G: Repeat the above procedure till measuring 2G. Now, empty the 9G jug and transfer the 2G of water from the 4G jug to the 9G jug. Finally, fill up the 4G jug completely, and now the 9G jug will have 6G of water, hence measuring 6G.

Conclusion

In this way, using the two unmarked jugs, we can measure all the quantities from 1G to 9G.

The document Water Jug Problem | Puzzles for Interview - Interview Preparation is a part of the Interview Preparation Course Puzzles for Interview.
All you need of Interview Preparation at this link: Interview Preparation
109 docs

Top Courses for Interview Preparation

109 docs
Download as PDF
Explore Courses for Interview Preparation exam

Top Courses for Interview Preparation

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

video lectures

,

past year papers

,

Free

,

Objective type Questions

,

practice quizzes

,

MCQs

,

mock tests for examination

,

Semester Notes

,

pdf

,

Important questions

,

Exam

,

Sample Paper

,

Water Jug Problem | Puzzles for Interview - Interview Preparation

,

Viva Questions

,

Extra Questions

,

Previous Year Questions with Solutions

,

Water Jug Problem | Puzzles for Interview - Interview Preparation

,

study material

,

Water Jug Problem | Puzzles for Interview - Interview Preparation

,

ppt

,

Summary

,

shortcuts and tricks

;