“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”
You pour water into A [5 0] … pour from the A into B till B fills [2 3]… empty B [2 0] … pour the the 2q from A to B [0 2]… fill up A [5 2]… now pour from A to B till B fills [4 3]…
first fill 3 qart pail and pou that into 5 qart pail
Then again fill 3 qart pail and pour into 5 qart pail but 5 qart pail takes only 2 qart remaining 1 qart.
Then all the water in 5 qart pail was emptied and pour the remaining 1 qart water of 3 qart pail in to 5 qart pail
And again fill 3 qart pail and pour that into 5 qart pail .
So right now there are 4 qart water in 5 qart pail
1. Fill up the A completely. A has 5 qt, B has 0 qt.
2. Pour water from A to B till B is full. A has 2 qt, B has 3 qt.
3. Empty B and pour from A to B. A has 0 qt, B has 2 qt.
4. Fill up A completely. A has 5 qt, B has 2 qt.
5. Pour water from A to B till B is full. A has 4 qt, B has 3 qt.
6. Empty B, you are left with 4 qt in A.
Get the 3qt pail and use it to fill 5qt pail. 3+3=6. So, what you have in the 3qt pail is exactly 1qt. Now, empty the 5qt pail and pour in the 1qt, now pour a full 3qt, and there you have it.
A = 5q
B = 3q
[A B] q level
You pour water into A [5 0] … pour from the A into B till B fills [2 3]… empty B [2 0] … pour the the 2q from A to B [0 2]… fill up A [5 2]… now pour from A to B till B fills [4 3]…
Voila… you have 4q in A
first fill 3 qart pail and pou that into 5 qart pail
Then again fill 3 qart pail and pour into 5 qart pail but 5 qart pail takes only 2 qart remaining 1 qart.
Then all the water in 5 qart pail was emptied and pour the remaining 1 qart water of 3 qart pail in to 5 qart pail
And again fill 3 qart pail and pour that into 5 qart pail .
So right now there are 4 qart water in 5 qart pail
fill 5, pour it in 3, 5 left with 2q
pour out 3, pour 5 into 3, 3 has 2q
fill 5, pour it in 3 until 3 fills to brim
now 5 has 4q
5 qt pail 3 qt pail
5 -> 3 qt. -> 3
(2remain) (3 qt….throw it)
………………..
(0 remain) -> 2 qt. -> 2 qt
……………
take newly
5 qt -> 1qt -> so that (2+1=3)
..
4qt. remains
5 qt - A, 3 qt - B
1. Fill up the A completely. A has 5 qt, B has 0 qt.
2. Pour water from A to B till B is full. A has 2 qt, B has 3 qt.
3. Empty B and pour from A to B. A has 0 qt, B has 2 qt.
4. Fill up A completely. A has 5 qt, B has 2 qt.
5. Pour water from A to B till B is full. A has 4 qt, B has 3 qt.
6. Empty B, you are left with 4 qt in A.
5 Pail, 3 Pail
Activity1: Fill 5 Pail using 3 Pail
Fill 5 Pail using 3 Pail. After 2 rounds 5 quart water is in 5 pail & 1 quart water in 3 pail ( 3*2 = 5+1).
Activity2 :Empty 5 Pail
Activity3: empty pail 3 into pail 5
Activity4: Fill pail 3 & empty into pail 5
Pail 5 now has 4 quarts
5 pail + 5pail=10 pail
remove 3 that is 7 now
remove 3 that is 4 now
Get the 3qt pail and use it to fill 5qt pail. 3+3=6. So, what you have in the 3qt pail is exactly 1qt. Now, empty the 5qt pail and pour in the 1qt, now pour a full 3qt, and there you have it.
Leave an Answer/Comment