# Water Jugs (10, 5 and 6) [duplicate]

I have three water jugs, one with 10 liters another with 5 and another with 6, how do i get 8 liters on the first one?

## marked as duplicate by A E, ʇolɐǝz ǝɥʇ qoq, Spencerkatty, Deusovi♦, DrunkWolfJan 30 '16 at 12:08

• Which ones of them are full, and which are not? – cst1992 Jan 29 '16 at 17:13

There is no need for the 5 liters jug. You can do it with only the 10 and 6 liters jugs (and in less steps than the alternate solutions).

1. 10 0 0 $\leftrightarrow$ Fill 10 liters jug.

2. 4 6 0 $\leftrightarrow$ Pour it in the 6 liters jug (now 4 liter in 10 liters jug)

3. 4 0 0 $\leftrightarrow$ Empty 6 liters jug

4. 0 4 0 $\leftrightarrow$ Pour the 4 liter from 10 liters jug to the 6 liters jug (now 4 liter in 6 liters jug)

5. 10 4 0 $\leftrightarrow$ Fill 10 liters jug again

6. 8 6 0 $\leftrightarrow$ Pour water from 10 liters jug to 6 liters jug to fill it

You will have 8 liter in 10 liters jug

• This seems rather wasteful. I mean, you essentially toss 12 liters of water to get 8. – tfitzger Jan 29 '16 at 17:05
• @tfitzger That water that he pours out/empties could just as well be poured into the original reservoir from which he filled the 10-liter jug. – Shane Jan 29 '16 at 22:17
• @Shane Not if it's from the tap. =) – jpmc26 Jan 29 '16 at 22:22
• @tfitzger Conserving water is not part of the puzzle as it's currently stated. – user253751 Jan 30 '16 at 11:06

Using only exactly 8L:

Assuming 10L, 6L, 5L. Bold indicate refill (top-up or complete)

• 0, 6, 0 (Using 6 new liters)
• 0, 1, 5
• 1, 0, 5
• 1, 5, 0
• 1, 6, 0 (Using one new liter)
• 1, 1, 5
• 2, 0, 5
• 2, 5, 0
• 2, 6, 0 (Using one new liter)
• 8, 0, 0

10 steps, but not a drop of extra water wasted or used.

• I like it. You may take a few more steps, but you waste nothing. – tfitzger Jan 29 '16 at 17:06

Heres a solution without needing to refil and starting with only 10L.

Jugs are arranged in the following order 10L 5L 6L

Starting with just the 10L jug full

10L - 0L --- 0L
4 ---- 0 ---- 6
4 ---- 5 ---- 1
9 ---- 0 ---- 1
9 ---- 1 ---- 0
3 ---- 1 ---- 6
3 ---- 5 ---- 2
8 ---- 0 ---- 2

• I like this, no wasting water and no refilling – Kevin Jan 29 '16 at 14:48
• still 2L wasted, which is not necessary – njzk2 Jan 29 '16 at 15:27
• No water is wasted @njzk2 - You've got your 8L needed for whatever purpose, then the remaining 2L in another jug. You have your total 10L still. – mbklnd Jan 29 '16 at 15:30
• @njzk2 the 2L isn't wasted... it's donated to a local, starving, homeless family and their scrappy-but-lovable dog. – WernerCD Jan 29 '16 at 15:44
• Of course, donating water to a thirsty family would be better; drink some water and you'll still be starving :) – chepner Jan 29 '16 at 16:41

Here's a solution that takes more steps than the others, but the problem doesn't say we're trying to minimize steps ;)   It plays on the idea that the 5- and 6-liter jugs allow you to create 1-liter increments as many times as you want.

1. Fill the 6-liter jug.
2. Pour from the 6-liter jug into the 5-liter jug. You have 1 liter remaining in the 6-liter jug.
3. Pour the 1 liter from the 6-liter jug into the 10-liter jug and empty the 5-liter jug.
4. Repeat steps 1–3 7 more times.

It's clunky but simple.

• I like this but I think it's even simpler if you just perform it twice, then dump in on full 6-liter jug – Kevin Jan 29 '16 at 14:56
• @Kevin One step faster than my initial thought of "6 into 5, leaving 1... 3 times... then five on top of the 3" – WernerCD Jan 29 '16 at 15:42
• @Kevin: I had considered that, but I just liked the idea of being able to create any positive integer value using this method. – dpwilson Jan 29 '16 at 16:15

Fill 10 liters jug.
Pour it in the 6 liter jug.
Pour the remaining 4 liter in the 5 liter jug.
Fill 10 liters again.
Empty the 6 liter jug.
Pour 6 liters from the 10 liter jug in the 6 liter jug.
Put content of 5 liter jug in 10 liter jug.

Fill the 6 liter jug and then pour it into the 10 jug.

• 10 liter jug has 6 liters of water.

Fill the 6 liter jug again and pour 5 liters into the 5 liter jug the remaining 1 liter into the 10 liter jug.

• 10 liter jug has 7 liters of water.

Repeat last step.

• 10 liter jug has 8 liters of water.

Assuming all three are empty and you have a tap:

10 5 6  Jugs
| | |
0 0 6
0 5 1
1 5 0
1 0 5
1 0 6
7 0 0
7 0 6
7 5 1
8 5 0


You have 8 liters in the 10L jug and 5 liters in the 5L jug.