There is a drum full of milk, people come for buying milk in the range of 1-40 litres. You can have only 4 cans to draw milk out of drum. tell me what should be the measurement of these four cans so that you can measure any amount of milk in the range of 1-40 litres.
Note: idea is to minimise the efforts to draw the milk, also you are allowed to take back the milk from bigger can to small can
Check your answer:-
*separate the caacity by hyphen to check, so if your answer is 1,2,3,4 check for 1-2-3-4 in increasing orderClick here to See Solution
Suppose you have ‘x’ no of cans and you are able to measure up to n litres.
Now if the next can is of capacity 2*n+1 , you can now measure from (n+1)L to 2n L by subtracting the measurement of x cans from the (2*n+1). And you can also measure upto 3n+1 litres by adding (measurements of x cans + 2n+1).
So the 1st can will be of 1L then 2nd can will be of 3L(2*1+1) and we can measure upto 3*1+1(3n+1) i.e 4 (1, 3-1, 3, 3+1).
n = 4 (with 2 cans of 1 and 3)
and the 3rd should be 2*n+1 => 9 and we can measure upto 3*n+1 i.e 13L.
n = 13 (with 3 cans of 1,3 and 9 L cans)
and the 4th can should be 2*n+1 i.e 27 and we can measure upto 3*n+1 i.e. 40.
so we just need 4 cans of 1, 3, 9 and 27 L capacity.
Lie tribe and Truth tribe