All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Empty the bucket (Posted on 2017-05-29)
You are in the desert and you have 3 buckets of water containing a,b,c liters respectively (a,b,c - positive integers).
You need an empty bucket for an unspecified purpose. Being in the desert you need the water and cannot just pour it away.
You have to pour the contents of one bucket into another one. But in any pouring, you must double the contents of the bucket which receives the water.
For example the sequence of bucket contents could be:

3 2 1
1 4 1
0 4 2

Now show that no matter what a,b,c are, you can always manage to empty a bucket under this constraint.

You may assume:
a>b>c

&
(capacity of each bucket)>(a+b)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re(3): Still stumped | Comment 9 of 12 |
(In reply to re(2): Still stumped by Steve Herman)

But, it now occurs to me that if we have an odd and an even bucket, the cycle must eventually return to its starting value.  This is because the process is "reversible".  Because only one of the buckets is even, (4,13) for instance can only come from (2,15).  The cycle cannot go from state a to b to c to b to c, because that would mean that b can be reached from either state a or state c.

And that means that starting with (2n, 2k+1), we can always get to (n, 2k+1+n), no matter what the relative values of k and n (equal, greater, or less than).  I am not sure if this helps or not, but it is another tool in our arsenal.

Edited on June 3, 2017, 2:31 pm
 Posted by Steve Herman on 2017-06-03 14:27:59

 Search: Search body:
Forums (0)