Wednesday, December 30, 2015

Equalize the buckets

You start with two buckets of water. First bucket has x litres and the second bucket has y litres. Both have enough capacity to hold x+y litres.

Now you do the following:

You take the bucket with the larger amount of water and from that pour water into the other bucket so that the other bucket has double the water.

So if x<y, then we go from (x,y) to (2x,yx).

You keep doing this till the buckets have an equal amount of water. Note that in some cases, you will loop indefinitely.

For what initial (x,y) will you be able to equalize the buckets, and not loop indefinitely?

3 comments:

  1. By observation appears as follows:

    If x/y = Xn/Xn-1, where Xn is from the pattern 1, 3, 5, 11, 21... given by Xn = Xn-1 + 2Xn-2 where Xo is 1, X1 is 3.

    Somehow dont like the solution, there must be something neater ..

    ReplyDelete
    Replies
    1. I believe you have it right, but can be phrased in simpler terms. Hint: Consider xn+xn1

      Did you prove that it works?

      btw, you can use latex in the comments. Put them inside dollar signs, so Dollar x_n + x_{n-1} Dollar looks like xn+xn1.

      Delete
    2. Actually upon further consideration, you are missing more.

      For instance, (x,y)=(15,1).

      Sorry for the misleading comment earlier.

      Delete