8
$\begingroup$

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 with 10 liters of water available. (so you cannot fill 10 liters jug again)

$\endgroup$
  • $\begingroup$ doable with only 8L initially, see puzzling.stackexchange.com/questions/25896/… $\endgroup$ – njzk2 Jan 29 '16 at 15:34
  • $\begingroup$ @njzk2 If you start with 8L in the 10L jug and you want to end up with 8L in the 10L jug (as this question's constraints require), isn't this just the null operation? $\endgroup$ – Lawrence Jan 30 '16 at 14:27
  • $\begingroup$ @AE In this puzzle, you start with a full 10L jug but can't get more water. The question you linked to had an infinitely large tub from which you could draw. $\endgroup$ – Lawrence Jan 30 '16 at 14:29
  • $\begingroup$ @Lawrence haha, yes. But no, my answer does not require that you know how much water you have, but it does use exactly 8L $\endgroup$ – njzk2 Jan 30 '16 at 18:15
9
$\begingroup$
10L jug - 5L jug  - 6L jug
10      -    0    -    0  
4       -    0    -    6 
4       -    5    -    1
9       -    0    -    1
9       -    1    -    0
3       -    1    -    6
3       -    5    -    2
8       -    0    -    2
$\endgroup$
  • $\begingroup$ Exactly this was what I was about to post. $\endgroup$ – AeJey Jan 29 '16 at 12:08
1
$\begingroup$

Legend: 10l jug / 5l jug / 6l jug
1. Start with 10l in the 10l jug => 10/0/0
2. Fill the 6l jug and fill the rest in the 5l jug => 0/4/6
3. Swap th 4l into the 10l jug and fill with the 6l jug the 5l jug => 4/5/1
4. Swap the 5l jug into the 10l jug and the remaining 1l from 6l jug to 5l jug => 9/1/0
5. Fill from th 9l the 6l jug => 3/1/6
6. FIll the 5l jug from the 6l jug => 3/5/2
7. Fill the 10l jug with the 5l jug => 8/0/2

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.