An algebra problem

This question was set in one of the renowned primary school from Singapore. Given to me by "anonymous" to solve.
Andy has \$200 more than Peter. Andy gives 60% of his money to Peter. Peter then gives 25% of his money to Andy. In the end, Peter has \$200 more than Andy. How much did Andy have at first?
This is a great problem to solve with algebra. Why don't you try it first, before reading further? It sounds kind of interesting... first one guy has \$200 more than the other, and in the end it's reversed.

Solution:

Let A be the initial amount Andy has, and P the initial amount Peter has.
Then we know that A = P + 200. We're going to use that later, but for now I'm going to write it all in terms of A and P.

Andy gives 60% of his money or 0.6A to Peter.

Peter has now P + 0.6A.
Andy has now 0.4A.

Peter then gives 25% of his money to Andy. But this isn't 0.25P because Peter doesn't have P dollars anymore because Andy already gave him some. It's 0.25 (P + 0.6A) that he gives back to Andy.

Peter has now 0.75(P + 0.6A)
Andy has 0.4A + 0.25 (P + 0.6A)

In the end, Peter has \$200 more than Andy. That gives us a way to write an equation:

0.75(P + 0.6A) = 200 + 0.4A + 0.25 (P + 0.6A)

It's now simple to solve this equation of two variables by first substituting A = P + 200. The rest of it is just basic manipulations.

0.75(P + 0.6(P + 200)) = 200 + 0.4(P + 200) + 0.25(P + 0.6(P + 200))

0.75(P + 0.6P + 120) = 200 + 0.4P + 80 + 0.25(P + 0.6P + 120)

0.75(1.6P + 120) = 280 + 0.4P + 0.25(1.6P + 120)

0.75(1.6P + 120) = 280 + 0.4P + 0.25(1.6P + 120)

1.2P + 90 = 280 + 0.4P + 0.4P + 30

0.4P = 220

P = 550

and so A = 750

Check:
First Peter had \$550, Andy \$750.
Then Andy gives \$450 to Peter.

Peter has now \$1000, Andy \$300.
Then Peter gives \$250 to Andy.

Peter has now \$750, Andy \$550.