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
Related Searches

study material

,

Extra Questions

,

pdf

,

Fill the Jug | Puzzles for Interview - Interview Preparation

,

practice quizzes

,

ppt

,

Objective type Questions

,

Free

,

Previous Year Questions with Solutions

,

Viva Questions

,

Semester Notes

,

Exam

,

Summary

,

past year papers

,

mock tests for examination

,

video lectures

,

shortcuts and tricks

,

Fill the Jug | Puzzles for Interview - Interview Preparation

,

Fill the Jug | Puzzles for Interview - Interview Preparation

,

Important questions

,

Sample Paper

,

MCQs

;