Solution 11

Let F3 and F5 be the water volumes in the 3 and 5 liter bottles respectively. The procedure to get exactly 4 liters can be described as follows:
 
 
Step no F5 F3 Description
1 5 0 Fill F5
2 2 3 Fill F3 from F5
3 2 0 Empty F3
4 0 2 Pour F5 into F3
5 5 2 Fill F5
6 4 3 Fill F3 from F5. F5 now contains the desired 4 liters! 

For the more mathematically minded reader the problem can be formulated as follows:  Find Sn = 4 given that

Sn = Sn-1 + tn

where S0 = 0 and  tn represents the change and thus only can take the values ±5 or ±3 . A condition is that for each n,  Sn must be non-negative not greater than 8 (max. volume in the two bottles).

The solution is: Sn = 4 = 3+3-5+3, i.e.

S1 = 0 + 3   (F3 is filled)
S2 = 3 + 3 = 6  (F3 is emptied in F5 and filled again; F5=3, F3=3)
S3 = 6 - 5 = 1  (F3 is filled in F5 that is poured out; F5=0, F3=1)
S4 = 1 + 3 = 4  (F3 is emptied in  F5 and filled again; F5=1, F3=3)

Remark: The two solutions aren't equal; in the first case only 3 liters of water is wasted, while 5 liters is wasted in the second solution !


Back to quiz page or to the course page


Last updated: 2003-04-13 by Ingvar Jönsson