You are standing next to a well, and you have two jugs. One jug has a volume of 3 litres and the other one has a volume of 5 litres. Immersing either jug in the well will completely fill it. You want exactly 4 litres. How do you get that?
There are two solutions that I know of by the way.
You want to calculate what are called the Bezout Coefficients for 3 and 5. Then multiply them by 4.
okay got it first fill the 5 then from 5 to 3 then you know there is 2 in 5 then from 5 to 3 and then 2 is in 3 then fill 5 again and full 3 ......4 in 5
Fill the 5 litre jug and then pour the water carefully into the 3 litre jug till it is full. You now have 2 litres left in the 5 litre jug. Now dump out the 3 litre jug and pour what's left in the 5 litre jug into the 3 litre jug. Now refill the 5 litre jug and fill up the 3 litre jug - should only take 1 litre to do this. What's left in the 5 litre jug will be 4 litres - just what you were asked for.
you copy paste chaise
Oh, I wasn't allowed to copy and paste?
Using Bezout's Identity, the gcd of 5 and 3 is 1, so there exist some integers x and y such that: 3x + 5y = 1 Those integers are x = 2, y = -1 multiplying by 4 gives: 3(4*2)+ 5*( 4*-1) = 4 so 3(8)+5(-4) = 4 you would fill up 8 times with the 3 liter jug, then take away 4 of the 5 liter jug.
Surely that only works if you have a third jug big enough to accommodate at least 7 litres? Either way, that's a nice answer, so points!
oh i didnt realize we were trying to accomplish this with only the two jugs at hand, my bad.
ive seen questions before where they ask something like, "is it possible to measure 1 liter of water if you have a container that holds x liters, and one that holds y liters?" i guess i automatically assumed it was the same type.
Join our real-time social learning platform and learn together with your friends!