Fill the Jug | Puzzles for Interview - Interview Preparation PDF Download

Introduction

If you have two jugs, one 4 liters and the other 3 liters, and you want to get 2 liters of water in the 4 liter jug, then this article will guide you through the steps. The jugs don't have any measuring marks, and they can be filled or emptied any number of times.

Solution

Thinking Recursively:

To get 2 liters of water in the 4 liter jug, we need to have either 1 liter of water in the 3 liter jug and 1 liter of water in the 4 liter jug, or 2 liters of water in the 4 liter jug. We can achieve this by following these steps:

First Approach:

  1. Fill the 4 liter jug with water completely.
  2. Pour the water from the 4 liter jug into the 3 liter jug, leaving 1 liter of water in the 4 liter jug and 3 liters of water in the 3 liter jug.
  3. Empty the 3 liter jug.
  4. Pour the 1 liter of water from the 4 liter jug into the empty 3 liter jug, leaving 0 liters of water in the 4 liter jug and 1 liter of water in the 3 liter jug.
  5. Fill the 4 liter jug with water completely again.
  6. Pour the water from the 4 liter jug into the 3 liter jug, which already has 1 liter of water, until the 3 liter jug is full, leaving 2 liters of water in the 4 liter jug.

Second Approach:

  1. Fill the 3 liter jug with water completely.
  2. Pour the water from the 3 liter jug into the 4 liter jug.
  3. Fill the 3 liter jug with water again.
  4. Pour the water from the 3 liter jug into the 4 liter jug until the 4 liter jug is full, leaving 2 liters of water in the 3 liter jug.
  5. Empty the 4 liter jug.
  6. Pour the 2 liters of water from the 3 liter jug into the empty 4 liter jug, resulting in 2 liters of water in the 4 liter jug.

Conclusion

In either approach, we need to follow 6 steps to get 2 liters of water in the 4 liter jug. It's important to note that we can use these jugs in different ways to get various amounts of water.

The document Fill the Jug | 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

Free

,

Important questions

,

Sample Paper

,

study material

,

video lectures

,

Previous Year Questions with Solutions

,

shortcuts and tricks

,

past year papers

,

MCQs

,

Fill the Jug | Puzzles for Interview - Interview Preparation

,

pdf

,

Fill the Jug | Puzzles for Interview - Interview Preparation

,

Viva Questions

,

Objective type Questions

,

Semester Notes

,

practice quizzes

,

mock tests for examination

,

Summary

,

ppt

,

Exam

,

Extra Questions

,

Fill the Jug | Puzzles for Interview - Interview Preparation

;