# How to measure 5 litres using 10L, 7L and 3L vessels

A milkman has 10 litres of milk in a 10 litre vessel. He has two additional vessels of 3 litres and 7 litres.

One customer needs 5 litre milk. He measured 5 litres using those 3 vessels. How?

• You should add a no computers tag – UnidentifiedX Apr 6 at 13:25
• Note that the L in "10L" etc. should be capitalized. – chrylis -cautiouslyoptimistic- Apr 6 at 17:47
• @chrylis-onstrike- Why? We use capital letters for units only when the unit is derived from a name (N = Newton, J = Joule, ...) and the litre was not named after a Ms Litre – Hagen von Eitzen Apr 7 at 6:15
• So interestingly, if you have 3 vessels with sizes <=10, then the most number of moves that you'd need to get anywhere is 8 which happens in this case and 1 other. This assumes that the vessels are all different sizes also. With repeated vessels there's a 9 move answer with 10l,10l,1l and trying to get 5l (also quite boring). – Dr Xorile Apr 10 at 23:53
• Oh, this also assumes that the biggest vessel is filled – Dr Xorile Apr 10 at 23:53

After each step, I will list the contents of the jars in this order: 3 7 10

1. Fill the 7-litre jar: 0 7 3
2. Fill the 3-litre from the 7-litre: 3 4 3
3. Empty 3-litre into 10-litre: 0 4 6
4. Fill the 3-litre from the 7-litre: 3 1 6
5. Empty 3-litre into 10-litre: 0 1 9
6. Transfer 7-litre into 3-litre: 1 0 9
7. Fill the 7-litre: 1 7 2
8. Fill the 3-litre from the 7-litre: 3 5 2
You now have 5 litres in the 7-litre jar.

One way takes

9 steps, or 10 steps to get 5L twice

Where a step counts as a filling a vessel, or transferring the contents to another vessel

Fill the 7L vessel to the top using the 3L vessel. (6 fills)
There will be 3+3+1 litres I’m the 7L vessel, meaning there are 2 left over in the 3L vessel.

Pour the 7L vessel into the 10L vessel. Pour the 2L into the 7L vessel. You now have 2L in the 7L vessel and 8L in the 10L vessel. (2 fills)
Finally, fill up the 3L vessel (at this point you already have 5L left over in the 10, however with an extra step you get 5L twice) and pour it into the 7. 2+3=5 so there are 5L in both the 10L vessel and the 7L vessel, either of which can be given to the customer.

Or in the chain form:

3L 7L 10L
0 0 10
3 0 7
0 3 7
3 3 4
0 6 4
3 6 1
2 7 1
2 0 8
0 2 8
3 2 5
0 5 5

• That's actually ten steps. Filling the 7L from the 3L requires two steps: from the 10L to the 3L, and then from the 3L to the 7L. – Lanny Strack Apr 6 at 8:14
• @LannyStrack good point! – Beastly Gerbil Apr 6 at 8:15
3L |7L |10L
---|---|----
0 | 7 | 3
---|---|----
3 | 4 | 3
---|---|----
0 | 4 | 6
---|---|----
3 | 1 | 6
---|---|----
0 | 1 | 9
---|---|----
1 | 0 | 9
---|---|----
1 | 7 | 2
---|---|----
3 | 5 | 2
---|---|----


• Is this not the same as lannys answer? – Beastly Gerbil Apr 6 at 8:17
• @BeastlyGerbil Sorry, but I did not noticed there were already answers, as I did not submit it right away. – Culver Kwan Apr 6 at 8:46

Here's a solution that doesn't need the 10 L jug to measure:

STEP                                             |CONTENT OF
|  3L | 7L
-------------------------------------------------+-----+----
Fill the 3L jug                                  |  3L | 0L
Pour the 3L contents into the 7L                 |  0L | 3L
Fill the 3L jug                                  |  3L | 3L
Pour the 3L contents into the 7L                 |  0L | 6L
Fill the 3L jug                                  |  3L | 6L
Pour the 3L contents into the 7L until it's full |  2L | 7L
Dispose of the 7L contents                       |  2L | 0L
Pour the 3L contents into the 7L                 |  0L | 2L
Fill the 3L jug                                  |  3L | 2L
Pour the 3L contents into the 7L                 |  0L | 5L

• You need the 10L jug simply because that is where the milk is, at the start. This is not a "fill from the river" problem. There is only a fixed amount of milk to start with. – Lanny Strack Apr 6 at 22:58
• @LannyStrack Although in this case he can just consider the 10l jug to be the "river". – Neil Apr 7 at 9:55

10L 3L 7L
10 0 0 -inital,
3 0 7,
3 3 4,
6 0 4,
6 3 1,
9 0 1,
9 1 0,
2 1 7,
2 3 5-final

So we have three buckets with 10L, 3L, 7L capacities each. Just follow the filling sequence as given below:

10L | 3L | 7L
----|----|-----
10  | 0  | 0
----|----|-----
7   | 3  | 0
----|----|-----
7   | 0  | 3
----|----|-----
4   | 3  | 3
----|----|-----
4   | 0  | 6
----|----|-----
1   | 3  | 6
----|----|-----
1   | 2  | 7
----|----|-----


Give this 2L to the customer for the time being. He must have space for 2L, as he is intending to buy 5L milk.

1   | 0  | 7
----|----|-----
1   | 3  | 4
----|----|-----


Now give this 3L to the customer. So in total the customer has 2L+3L=5L milk.

### 10L_______7L_______3L

0] 10________0_________0

1] 7_________0_________3

2] 7_________3_________0

3] 4_________3_________3

4] 4_________6_________0

5] 1_________6_________3

6] 1_________7_________2

7] 8_________0_________2

8] 8_________2_________0

9] 5_________2_________3

• You missed a step between 8 and 9. – Lanny Strack Apr 10 at 16:02
• I see you've already solved this, thanks for your diligence – Te ro Apr 10 at 19:13

First we assume the 10Ljug is full. First from the 10L we fill the 7Ljug so we have 3,7,0 litres in each jug. Then we fill twice the 3Ljug from the 7L jug and we put the milk into the 10Ljug so we have 9,1,0. From the 7L jug we put 1L into the 3Ljug so we have 9,0,1. From the 10Ljug we fill the 7Ljug so we have 2,7,1. From the 7L we fill the 3Ljug so we have 2,5,3. In total we have 6 measurements,

3, 7, 0

6, 4, 0

9, 1, 0

9, 0, 1

2, 7, 1

2, 5, 3