Saturday, September 19, 2015

IMO Shortlist 1994
Peter has 3 accounts in a bank, each with an integral number of dollars. He is only allowed to transfer money from one account to another so that the amount of money in the latter is doubled. Prove that Peter can always transfer all his money into two accounts. Can he always transfer all his money into one account? 
Let A, B, C be the number of dollars in the account 1, account 2 and account 3 respectively and A <= B <= C. If A = 0, we are done. At any time we want to reduce min(A,B,C) to the point where it is 0. The values of A, B and C can keep changing
Euclidean theorem monotonically reduces a number by using form B = qA + r with 0 <= r < A. We use this form. With this form if we can reduce B to r then we are done. Since r < A, we would have reduced min(A,B,C) which was our aim.
The question however says we have to double so we use binary representations. Let
q =  2M^k + ... + 2M1 + M0 be the binary representation of q and where Mi is 0 or 1. To reduce B to r, in step i of the algorithm, we transfer money to account 1. The transfer is from account 2 if Mi-1 = 1 and from account 3 if Mi-1 = 0.  The number of dollars in the first account starts with A and keeps doubling in each step. Thus we transfer Aq dollars from account 2 to account 1, and we are left with B-Aq = r dollars in account 2. At this point we have reduced min
The answer to the last question is that it is not possible when the number is odd.
Lets try this out with sample numbers
We have accounts with 2, 5, 16
B = 2* A + 1
so q =2 and it can be written as 0 + 2 * 1 for the binary representation of 2
We transfer Aq = 2 * 2 = 4 dollars to 1 and now have 6, 1,16
Now A, B, C has changed and we have A = 1, B= 6, C = 16
now B has q=6 and r = 0 and since m1 was 1 and m2 is 1, we have the transfer again from B.
 This leaves us with A=0, B=7 and C=16.

Note that we cannot reduce any further.

No comments:

Post a Comment