5
$\begingroup$

You have three buckets, two big buckets holding 8 litres of water each and one small empty bucket that can hold 3 litres of water. How will you split the 16 litres of water to four people evenly? Each person has a container but once water is distributed to someone it cannot be taken back.

In this puzzle, we need to allocate 4 litres to each person. So I considered the initial state as below

8 8 0 [0, 0, 0, 0]

The values in the bracket are the water given to those 4 people. I tried the below steps

5 8 3 [0, 0, 0, 0]
5 8 0 [3, 0, 0, 0]
5 5 3 [3, 0, 0, 0]
5 5 0 [3, 3, 0, 0]
2 8 0 [3, 3, 0, 0]
0 8 2 [3, 3, 0, 0]
0 7 3 [3, 3, 0, 0]
0 4 3 [3, 3, 3, 0]
0 1 3 [3, 3, 3, 3]
0 0 3 [4, 3, 3, 3]

But I couldnt take it further by giving those 1 litre for rest of the 3 persons since there is a constraint that water given to person cant be retrieved back.
Any help/hint towards final solution is greatly appreciated.

$\endgroup$
4
  • $\begingroup$ To get the best possible answers, you should explain what your thoughts on the problem are so far. That way, people won't tell you things you already know, and they can write answers at an appropriate level; also, people tend to be more willing to help you if you show that you've tried the problem yourself. $\endgroup$ Mar 8, 2013 at 10:32
  • $\begingroup$ @ZevChonoles Sure. Let me update the question now. $\endgroup$
    – sundar
    Mar 8, 2013 at 10:36
  • $\begingroup$ @sundar: Is the water in the big buckets to begin with, or is it in another container? $\endgroup$ Mar 8, 2013 at 10:39
  • $\begingroup$ @Dennis: The question is rather clear in that respect: The big buckets are "holding" water and the small one is empty and "can hold" water. $\endgroup$
    – joriki
    Mar 8, 2013 at 10:43

3 Answers 3

6
$\begingroup$
8 8 0 [0 0 0 0]
8 5 3 [0 0 0 0]
8 5 0 [3 0 0 0]
8 2 3 [3 0 0 0]
8 0 3 [3 2 0 0]
8 3 0 [3 2 0 0]
5 3 3 [3 2 0 0]
5 6 0 [3 2 0 0]
2 6 3 [3 2 0 0]
2 8 1 [3 2 0 0]
2 8 0 [3 2 1 0]
0 8 2 [3 2 1 0]
0 7 3 [3 2 1 0]
3 7 0 [3 2 1 0]
3 4 3 [3 2 1 0]
6 4 0 [3 2 1 0]
6 1 3 [3 2 1 0]
6 0 3 [3 2 1 1]
8 0 1 [3 2 1 1]
8 0 0 [4 2 1 1]
5 0 3 [4 2 1 1]
5 3 0 [4 2 1 1]
2 3 3 [4 2 1 1]
0 3 3 [4 4 1 1]
0 0 3 [4 4 4 1]
0 0 0 [4 4 4 4]
$\endgroup$
4
  • $\begingroup$ +1 Nice! Any particular approach to do this, better than trial and error? $\endgroup$
    – polkjh
    Mar 8, 2013 at 11:13
  • $\begingroup$ @polkjh: The only insights I remember having are a) I was always trying to do it with $3+1$ and I needed to include some $2$s, and b) a $1$ or $2$ needed to be dispensed whenever possible, preferably a $1$, to produce as many $1$s and $2$s as possible early on, since that's no longer possible once you only have $6$ litres left. $\endgroup$
    – joriki
    Mar 8, 2013 at 11:21
  • $\begingroup$ Is the 6th line redundant? $\endgroup$ Mar 8, 2013 at 13:38
  • $\begingroup$ @John: You mean you could go directly from the $5$th to the $7$th? I don't think so. The first two numbers stand for the big buckets (as in the OP's notation); you can't just pour $3$ litres from one big bucket into the other without using the small bucket to measure them. $\endgroup$
    – joriki
    Mar 8, 2013 at 13:52
1
$\begingroup$

Here is a solution using 24 steps (one fewer than joriki's solution). I believe this is minimal, since I wrote a shortest path algorithm to find it:

8 8 0 [0 0 0 0]
8 5 3 [0 0 0 0]
8 5 0 [3 0 0 0]
8 2 3 [3 0 0 0]
8 0 3 [3 2 0 0]
8 3 0 [3 2 0 0]
5 3 3 [3 2 0 0]
5 6 0 [3 2 0 0]
2 6 3 [3 2 0 0]
2 8 1 [3 2 0 0]
2 8 0 [4 2 0 0]
2 5 3 [4 2 0 0]
0 7 3 [4 2 0 0]
3 7 0 [4 2 0 0]
3 4 3 [4 2 0 0]
6 4 0 [4 2 0 0]
6 1 3 [4 2 0 0]
8 1 1 [4 2 0 0]
8 1 0 [4 2 1 0]
5 1 3 [4 2 1 0]
5 1 0 [4 2 4 0]
2 1 3 [4 2 4 0]
0 1 3 [4 4 4 0]
0 4 0 [4 4 4 0]
0 0 0 [4 4 4 4]
$\endgroup$
0
$\begingroup$

Above can be completed in 13 steps: 8,8,0[0,0,0,0] 8,5,3[0,0,0,0] 8,5,0[3,0,0,0] 5,5,3[3,0,0,0] 5,5,0[3,3,0,0] 5,2,3[3,3,0,0] 5,2,0[3,3,3,0] 5,0,2[3,3,3,0] 4,0,3[3,3,3,0] 0,0,3[3,3,3,4] 0,0,2[4,3,3,4] 0,0,1[4,4,3,4] 0,0,0[4,4,4,4]

$\endgroup$
1
  • $\begingroup$ Some of the last steps are not allowed, because they require you to measure out $1$ litre. Once you get to 0,0,3 [3,3,3,4], you're stuck, because you can only transfer the $3$ litres back and forth without being able to split it up properly. $\endgroup$
    – Théophile
    Feb 4, 2018 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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