We have a pile of 2013 black balls and 2014 white balls, and a reserve of as many white balls as we want. We draw two balls: if they are of the same color, we put back one white ball, otherwise we put back the black ball. We repeat this until only one ball remains. What is its color?
The invariant is the parity of the number of black balls in the pile. Indeed, if at a given moment, the pile contains $N$ black balls, in the next draw it will contain either $N$, or $N-2$, in any case a number of the same parity as $N$. Because if two black balls are drawn and one white ball is put back, it will contain $N-2$, if two white balls are drawn and one white ball is put back, it will contain $N$, and the same if one white ball and one black ball are drawn and one black ball is put back. Since at the first draw, there is an odd number of black balls (2013), there will always be an odd number of black balls, so there will never be zero. The last ball is therefore necessarily a black ball.