You have two water bottles both empty, one with the capacity to hold 11 liters of water and the other 6 liters and an endless supply of water. What is the minimum number of moves required to get 9 liters?
Details and assumptions :
Filling a bottle, emptying a filled bottle and transferring water from one bottle to another counts as a move.
You have to transfer as many liters as you can from a filled bottle to another empty or partially filled bottle. For example, if the 11 liters bottle has 7 liters of water and the 6 liters bottle has 3 liters already filled, if you want to transfer water from the 11 liters bottle to the 6 liters bottle, the 11 liters bottle will have 4 liters and the 6 liters bottle will have 6 liters.
While filling the bottle, you have to fill it to the bottle's maximum capacity.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Steps:-
1.Fill the 11 litre bottle. (11,0)
2.Transfer water to the 6 litre bottle from the 11 litre bottle. (5,6)
3.Empty the 6 litre bottle. (5,0)
4.Transfer water to the 6 litre bottle from the 11 litre bottle. (0,5)
5.Fill the 11 litre bottle. (11,5)
6.Transfer water to the 6 litre bottle from the 11 litre bottle. (10,6)
7.Empty the 6 litre bottle. (10,0)
8.Transfer water to the 6 litre bottle from the 11 litre bottle. (4,6)
9.Empty the 6 litre bottle. (4,0)
10.Transfer water to the 6 litre bottle from the 11 litre bottle. (0,4)
11.Fill the 11 litre bottle. (11,4)
12.Transfer water to the 6 litre bottle from the 11 litre bottle. (9,6)