TITLE: Three baskets and transferring apples
QUESTION [7 upvotes]: This is from a math contest, and I do not have the idea how to approach it:

There are 6, 7, and 11 apples in three baskets. The goal is to make
  all basket contain equal number of apples, but while transferring
  apples from one basket to another, one can transfer only the number of
  apples that is already contained in destination basket. Also, only
  three such transfers are allowed. Is that possible?

Obviously, the answer can be deduced by computer brute force simulation, but this is not the spirit of the desired answer.
I appreciate any idea.

REPLY [3 votes]: A little late to the party, but here goes...
Every transfer does two things: it reduces the source basket's quantity by the quantity of the target basket (a - b), and it doubles the quantity of the target basket (b + b). We know from the fact that there are 24 apples (6 + 7 + 11 = 24) that our goal is to have 8 apples in each basket (24 / 3 = 8). We want to achieve that by performing a maximum of 3 transfers. Each transfer should bring us closer to our goal, therefore a transfer is considered most optimal if it results in a basket of 8, or slightly less optimal but still worthwhile if it results in a basket of 4, which can be doubled to 8 in a subsequent transfer (4 + 4 = 8).
So, on each transfer, assess the following questions, in order:
1) Are there two baskets such that a - b = 8?
2) Are there two baskets such that a - b = 4?

If the first answer is yes, then transfer from a to b and start over with the new basket configuration.
If the second answer is yes, then transfer from a to be and start over with the new basket configuration.
If both answers are no, then it probably cannot be done.
Using this process, we get the following:
(6, 7, 11)
1) There are no baskets such that a - b = 8.
2) 11 - 7 = 4, so transfer from the third basket to the second.

(6, 14, 4)
1) 14 - 6 = 8, so transfer from the second basket to the first.

(12, 8, 4)
1) 12 - 4 = 8, so transfer from the first basket to the third.

(8, 8, 8)