Contents
How do you solve the water jug riddle?
Fill the 3-gallon jug and pour it into the 5-gallon jug. Fill the 3-gallon jug again and use it to fill the 5-gallon jug. You have 1 gallon. Empty the 5-gallon jug and pour the 3-gallon jug’s remaining gallon in.
How can you get exactly 2 gallons of water into the 4-gallon jug?
Neither jug has any measuring markings on it. How can you get exactly 2 gallons of water in the 4-gallon jug?…They are:
- We can fill a jug from the pump.
- We can pour water out of a jug to the ground.
- We can pour water from one jug to another.
- There is no measuring device available.
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 much is a 5 gallon water jug full of quarters?
208,000,000/808.5 gives you 257,612 quarters, but with 75% packing efficiency, only 193,208 quarters will fit in your drum. That comes to $48,302 dollars worth of quarters.
Is 3 gallons of water a day too much?
Given that evidence is lacking and many factors affect individual hydration needs, drinking a gallon (3.8 liters) of water per day is likely arbitrary and unnecessary — unless your body requires that much water for proper hydration.
What is the meaning of 1 gallon?
1 : a United States unit of liquid capacity equal to four quarts or 231 cubic inches or 3.785 liters. 2 : a British unit of liquid and dry capacity equal to four quarts or 277.42 cubic inches or 4.544 liters. — called also imperial gallon.
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 to fill a m liter jug with water?
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. Repeat steps 1,2,3 till either n liter jug or the m liter jug contains d litres of water.
How many liters are in two jugs of water?
You are given two jugs with capacities jug1Capacity and jug2Capacity liters. There is an infinite amount of water supply available. Determine whether it is possible to measure exactly targetCapacity liters using these two jugs.
How to pour water between two jugs in Python?
The algorithm below basically always pours from the smaller jug into the bigger jug, how would you improve the solution ? I think I get the minimum number of steps this way… am I correct ?