Solution to the Problem:
Call one ten-gallon milk can A and the other B, then proceed as follows:
|
Can A |
Can B |
5-Qt Pail |
4-Qt Pail |
Initial Amounts (in quarts) |
40 |
40 |
0 |
0 |
Fill 5 Pail from Can A |
35 |
40 |
5 |
0 |
Fill 4 Pail from 5 Pail, leaving 1 quart in 5 pail |
35 |
40 |
1 |
4 |
Empty 4 Pail into Can A |
39 |
40 |
1 |
0 |
Pour the quart from 5 pail into 4 pail |
39 |
40 |
0 |
1 |
Fill 5 Pail from Can A |
34 |
40 |
5 |
1 |
Fill 4 Pail from 5 Pail, leaving 2 quarts in 5 pail |
34 |
40 |
2 |
4 |
Empty 4 pail into can A |
38 |
40 |
2 |
0 |
Fill 4 pail from can B |
38 |
36 |
2 |
4 |
Pour from 4 pail into can A until A is filled, leaving 2 quarts in 4 pail |
40 |
36 |
2 |
2 |
Click here for Danilo's solution
Here is James Alarie's solution:
Number the cans 0 through 3 that hold 10 gallons, 10 gallons, 4 quarts,
and 5 quarts. Pour thusly:
0 -> 2 : 36 40 4 0
1 -> 3 : 36 35 4 5
2 -> 1 : 36 39 0 5
3 -> 0 : 40 39 0 1
3 -> 2 : 40 39 1 0
0 -> 2 : 37 39 4 0
2 -> 3 : 37 39 0 4
1 -> 3 : 37 38 0 5
3 -> 2 : 37 38 4 1
2 -> 1 : 37 40 2 1
1 -> 3 : 37 36 2 5
3 -> 0 : 40 36 2 2