A box contains p white balls and q black balls. Beside the box
there is a pile of black balls. Two balls are taken out from the
box.
If they are of the same colour, a black ball from the pile is put into
the box.
If they are of different colours, the white ball is put back into the box.
This procedure is repeated until the last pair of balls are removed from the box and one last ball is put in.
What is the probability that this last ball is white?
Source: Australian Olympiad 1983
At each turn the number of balls in the box are reduced by 1, until there is only one ball in the box.
If the drawn pair is different, then a black and a white ball are removed, and then a white ball is put in. The net effect is to remove one black ball from the box.
If the drawn pair are both both black, then two black balls are removed and and then one is put back. The net effect is to remove one black ball.
If the drawn pair are both white, then two white balls are removed and a black ball is put in. The net effect is to swap two white balls for a black ball.
SO, NET EFFECT, WHITE BALLS ARE ONLY EVER REMOVED IN PAIRS. IF p IS ODD, THEN THE LAST BALL MUST BE WHITE.
I have solved the easy half of the problem. If p is even, more analysis is required.