How do you solve a 3 jug problem?

First, water is poured from the 8 litre jug into the 5 litre jug, leaving 3 litres of water in the original 8 litre jug. Next, water is poured from the 5 litre jug into the 3 litre jug, so we now have 3 litres of water in the 8 litre jug, 2 litres of water in the 5 litre jug and 3 litres of water in the 3 litre jug.

How do you get 4 gallons from 3 and 5 Die Hard?

Simple: Fill the five-gallon jug with water. Empty three gallons into the three-gallon jug, leaving two gallons in the five-gallon jug. Empty the three-gallon jug completely, and then refill it with the remaining two gallons from the five-gallon jug.

What is the three jug problem?

Three jugs are given with water in them, each containing an integer number of pints. It is allowed to pour into any jug as much water as it already contains, from any other jug. Prove that after several such pourings it is possible to empty one of the jugs.

How do you fix a water jug problem?

Water Jug problem using BFS

  1. Empty a Jug, (X, Y)->(0, Y) Empty Jug 1.
  2. Fill a Jug, (0, 0)->(X, 0) Fill Jug 1.
  3. Pour water from one jug to the other until one of the jugs is either empty or full, (X, Y) -> (X-d, Y+d)

What is water jug problem?

Water pouring puzzles (also called water jug problems, decanting problems, measuring puzzles, or Die Hard with a Vengeance puzzles) are a class of puzzle involving a finite collection of water jugs of known integer capacities (in terms of a liquid measure such as liters or gallons).

Can you get exactly 4 liters?

Empty the 3-liter bowl, and then transfer the 2 liters from the 5-liter bowl into it. Now fill the 5-liter bowl again, then pour water carefully from the 5-liter bowl into the 3-liter bowl until it is full – exactly one more liter. The 5-liter bowl now has exactly 4 liters.

What could be the problem characteristics for a water jug problem?

In the water jug problem in Artificial Intelligence, we are provided with two jugs: one having the capacity to hold 3 gallons of water and the other has the capacity to hold 4 gallons of water. There is no other measuring equipment available and the jugs also do not have any kind of marking on them.

Is there a solution to the water jug problem?

The water jug problem can be solved with just two jugs – one that can hold 5 litres of water and the other that can hold 3 litres of water, if there is also an unlimited supply of water from a tap and a sink. Show the series of state diagrams that solve this problem.

How much water is in a 3 litter jug?

Again, fill the 3-litter jug with water and pour into 5 litre jug (Now 5 litter Jug contains 5 litre water and 3 litre jug contains 1 litre water. Empty 5 litre jug and pour 1 litre water from 3 litre jug (now, 5 litre jug contains 1 litre water) Again, fill 3 litre jug and pour it into 5 litre jug (Now 5 litre jug contains 4 litre water)

How big is the water jug in Die Hard 3?

You’ve got to defuse a bomb by placing exactly 4 gallons (15 L) of water on a sensor. The problem is, you only have a 5 gallon (18.9 L) jug and a 3 gallons (11 L) jug on hand! This classic riddle, made famous in Die Hard 3, may seem impossible without a measuring cup, but it is actually remarkably simple.

How to measure jug J1 of 5 liters?

For example, if we have a jug J1 of 5 liters (n = 5) and another jug J2 of 3 liters (m = 3) and we have to measure 1 liter of water using them. The associated equation will be 5n + 3m = 1. First of all this problem can be solved since gcd (3,5) = 1 which divides 1 (See this for detailed explanation).

You Might Also Like