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?
7 Answers
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).
10 0 0
$\leftrightarrow$ Fill 10 liters jug.4 6 0
$\leftrightarrow$ Pour it in the 6 liters jug (now 4 liter in 10 liters jug)4 0 0
$\leftrightarrow$ Empty 6 liters jug0 4 0
$\leftrightarrow$ Pour the 4 liter from 10 liters jug to the 6 liters jug (now 4 liter in 6 liters jug)10 4 0
$\leftrightarrow$ Fill 10 liters jug again8 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
-
$\begingroup$ This seems rather wasteful. I mean, you essentially toss 12 liters of water to get 8. $\endgroup$– tfitzgerJan 29, 2016 at 17:05
-
1$\begingroup$ @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. $\endgroup$– ShaneJan 29, 2016 at 22:17
-
-
1$\begingroup$ @tfitzger Conserving water is not part of the puzzle as it's currently stated. $\endgroup$ Jan 30, 2016 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.
-
1$\begingroup$ I like it. You may take a few more steps, but you waste nothing. $\endgroup$– tfitzgerJan 29, 2016 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
-
1$\begingroup$ I like this, no wasting water and no refilling $\endgroup$– KevinJan 29, 2016 at 14:48
-
-
3$\begingroup$ 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. $\endgroup$– mbklndJan 29, 2016 at 15:30
-
3$\begingroup$ @njzk2 the 2L isn't wasted... it's donated to a local, starving, homeless family and their scrappy-but-lovable dog. $\endgroup$– WernerCDJan 29, 2016 at 15:44
-
1$\begingroup$ Of course, donating water to a thirsty family would be better; drink some water and you'll still be starving :) $\endgroup$– chepnerJan 29, 2016 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.
- Fill the 6-liter jug.
- Pour from the 6-liter jug into the 5-liter jug. You have 1 liter remaining in the 6-liter jug.
- Pour the 1 liter from the 6-liter jug into the 10-liter jug and empty the 5-liter jug.
- Repeat steps 1–3 7 more times.
It's clunky but simple.
-
3$\begingroup$ I like this but I think it's even simpler if you just perform it twice, then dump in on full 6-liter jug $\endgroup$– KevinJan 29, 2016 at 14:56
-
$\begingroup$ @Kevin One step faster than my initial thought of "6 into 5, leaving 1... 3 times... then five on top of the 3" $\endgroup$– WernerCDJan 29, 2016 at 15:42
-
$\begingroup$ @Kevin: I had considered that, but I just liked the idea of being able to create any positive integer value using this method. $\endgroup$– dpwilsonJan 29, 2016 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.