In this case, there is a solution obtained by filling the five gallon jug twice and emptying the three gallon jug twice. (Solution. Fill the five gallon jug and empty three gallons to the three gallon jug. Empty the three gallon jug.

Similarly, How did they get 2 gallons in Die Hard 3?

Fill the 5-jug with water from your 3-jug.

You now have 1 gallon (3.8 L) in the 3-jug and 5 gallons (18.9 L) in the 5-jug. This is because, in the last step, you only had 2 gallons (7.6 L) of space left over, so you could only pour 2 gallons.

Additionally, How do you fix a water jug problem?
Water jug problem in Artificial Intelligence

  1. (x,y) If x<4. (4,y) Fill the 4 gallon jug completely.
  2. (x,y) if y<3. (x,3) Fill the 3 gallon jug completely.
  3. (x,y) If x>0. (x-d,y) …
  4. (x,y) If y>0. (x,y-d) …
  5. (x,y) If x>0. (0,y) …
  6. (x,y) If y>0. (x,0) …
  7. (x,y) If (x+y)<7. (4, y-[4-x]) …
  8. (x,y) If (x+y)<7. (x-[3-y],y)

Can you solve the water puzzle?

Here, you are using a 4-cup (blue) glass and a 9-cup (red) glass to measure out 6 cups of water.



Give it a try!

Red Glass (9 cups) Blue Glass (4 cups) Action
5 0 Transfer 4 cups to the blue glass
1 4 Empty the blue glass
1 0 Transfer the remaining water from the red glass to the blue one
0 1 Fill the red glass


26 janv. 2016

How do you measure exactly 2 gallons of water from a well using a 4 gallon jug and a 7 gallon jug?

Fill the 7 gallon and pour into the 4 gallon to obtain 4/4, 6/7. Empty the 4 gallon, then pour the 6 gallons into the 4 to obtain 4/4, 2/7. Empty the 4 gallon and pour the 2 gallons to obtain 2/4, 0/7.

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).

What is 21 out of 42 die hard?

“What is 21 out of 42?” At the time of the film’s release, there had been 42 presidents, so 21 out of 42 was President Chester A. Arthur, and Chester A. Arthur Elementary School was where Simon had hidden one of his bombs (a fake one, as it turns out) as a distraction.

Which solution is most efficient for solving water jug problem why?

Numerous source codes have been devised for solving Water Jug problems using recursion, searching and sorting algorithms. The solution written using Breadth-First Search is considered to be one of the most optimum solutions.

What is water jug problem explain with example?

A Water Jug Problem: You are given two jugs, a 4-gallon one and a 3-gallon one, a pump which has unlimited water which you can use to fill the jug, and the ground on which water may be poured. Neither jug has any measuring markings on it. How can you get exactly 2 gallons of water in the 4-gallon jug?

What is water jug problem explain in brief?

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).

How do you do the liquid puzzle?

How to solve dispenser puzzle?




To do so:

  1. Pour the whole liquid to the tallest vial.
  2. Pour the contents to the medium vial.
  3. Pour the contents of the medium vial to the smallest vial.
  4. Pour the contents of the smallest vial to the tallest vial.

How will you measure exactly 6 liters of water from jugs 12 8 and 5 liters in which the 12 liter jug is full of water?

Empty 5 liter jug pouring milk back to 12 liter jug back. At this point – 8 liter jag contains 6 liters and 12 liter Jug contains 6 liters milk. This is the answer we want – 12 liter Jug contains 6 liters milk only.

How would you measure 4 Litres of water if you have 3 Litre and 5 Litre canisters?

Once the 3 liter bottle is full, what is left in the 5 liter bottle is 2 liters. Then you empty out the 3 liter until it matches the height of the 5 liter. Pour the remaining contents of the 3 liter bottle in the 5 liter bottle to get exactly 4 liters.

How much does 6 gallon of water weigh?

At room temperature (70°F or 21°C), a gallon of water weighs 8.33lb (3.78kg).

Gallons of water Pounds Kilos
6 gallons
49.97 lb

22.67 kg
7 gallons 58.3 lb 26.45 kg
8 gallons 66.63 lb 30.22 kg
9 gallons 74.96 lb 34 kg


18 sept. 2020

Which is greater a 2.75 gallon container of juice or a 12 liter container of juice?

Answer Expert Verified Only thing that needs to be done is to compare the volume of the liquids and find the one that is greater. One container has 2.75 gallons of juice and the other container has 12 liter of juice. So the container having 12 liters of juice is greater.

How liters are in a gallon?

There are three different sizes of gallons used today. The imperial gallon is 4.54 liters and common in the Commonwealth states and some Caribbean nations. The US gallon is about 3.785 liters and common in the United States and Latin America. The U.S dry gallon is about 4.405 Litres or 1⁄8 US bushel.

How do you solve a 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.

What is a water jug?

1. water jug – a jug that holds water. jug – a large bottle with a narrow mouth.

Who was the 21st president die hard?

New York City, New York, U.S. Menands, New York, U.S. Chester Alan Arthur (October 5, 1829 – November 18, 1886) was an American lawyer and politician who served as the 21st president of the United States from 1881 to 1885.

What percent is 25 out of 42?

Percentage Calculator: 25 is what percent of 42? = 59.52.

What is 30 out of 42 as a percentage?

Now we can see that our fraction is 71.428571428571/100, which means that 30/42 as a percentage is 71.4286%.

Which algorithm is used to solve water jugs?

Water Jug problem using BFS.

What is the goal of water jug problem?

The goal state is (2, n) for any value of n. State Space Representation: we will represent a state of the problem as a tuple (x, y) where x represents the amount of water in the 4-gallon jug and y represents the amount of water in the 3-gallon jug. Note that 0 ≤ x ≤ 4, and 0 ≤ y ≤ 3.

How do you solve a water jug without AI?

Problem: There are two jugs of volume A litre and B litre. Neither has any measuring mark on it. There is a pump that can be used to fill the jugs with water. How can you get exactly x litre of water into the A litre jug.



and Transfer water jug.

Rule State Process
4 (X,Y | Y>0) (X,0) {Empty 3-gallon jug}


26 avr. 2020