Contents
What is the equation between D M and N that must be satisfied for solving the water jug problem?
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). Using the Extended Euclid algorithm, we get values of n and m for which the equation is satisfied which are n = 2 and m = -3.
Is water sort puzzle free?
FREE & EASY TO PLAY. NO penalties & time limits; you can enjoy Water Sort Puzzle at your own pace!
What is the water jug riddle?
Empty the 3-gallon jug, and then pour in the 2 remaining gallons from the other jug. Fill the now empty 5-gallon jug and pour 1 gallon into the 3-gallon jug. There are 4 gallons left in the 5-gallon jug.
What is operator in water jug problem?
Possible legal operators are: filling Jug-A, filling Jug-B, emptying Jug-A onto the ground, emptying Jug-B onto the ground, pouring Jug-A into Jug-B (until either Jug-A is empty or Jug-B is full), or pouring Jug-B into Jug-A (until either Jug-B is empty or Jug-A is full).
How to answer the two water jug puzzle?
Depending upon which jug is chosen to be filled and which to be emptied we have two different solutions and the minimum among them would be our answer. Fill the m litre jug and empty it into n liter jug. Whenever the m liter jug becomes empty fill it. Whenever the n liter jug becomes full empty it.
How many liters are in two water jugs?
Both the jugs are initially empty. The jugs don’t have markings to allow measuring smaller quantities. You have to use the jugs to measure d liters of water where d < n. Determine the minimum no of operations to be performed to obtain d liters of water in one of jug.
What was the water jug Riddle in Die Hard?
The Water Jug Riddle (AKA The Die Hard Riddle) This is a problem that is prominently featured in the film Die Hard With a Vengeance. You have a 3-gallon and a 5-gallon jug that you can fill from a fountain of water. The problem is to fill one of the jugs with exactly 4 gallons of water.
How do you fill up a 3 gallon water jug?
We can also consider the route: 1. Fill up the 3-gallon jug 2. Transfer to the 5-gallon jug 3. Fill up the 3-gallon jug again 4. Transfer water to fill up the 5-gallon jug, leaving 1 gallon in the 3-gallon jug 5. Empty out the 5-gallon jug 6. Transfer the 1 gallon to the 5-gallon jug 7. Fill up the 3-gallon jug and transfer that to the 5-gallon jug