How do I prove that this algorithm about selecting sets of 3 objects works? I have a selection of balls of different colours. I want to remove selections of three differently coloured balls in order to leave as few as possible.
For example if I have 3 red, 4 green, 5 blue and 2 orange, I can do (for example)
red, green, blue
red, green, blue
red, blue, orange
green, blue, orange

This leaves 2 balls (green and blue).
I think that an algorithm to do this is to just always take the three colours you have most left of (selecting arbitrarily in the case of ties). It seems obvious that this must work, and I'm fairly sure I can prove it using a relatively complicated set of inequalities, but I can't put my finger on the simplest explanation why. Can anyone explain?
 A: Since your not asking for a proof, I'll provide a possible rationale.  Suppose instead of your distribution, you had $3$ balls of each color.  You would be able to make selections until $0$ balls were left using your algorithm.  On the other hand, suppose you had $12$ red balls, and $0$ of each of the other colors.  In this case, you would have $12$ balls remaining.  Note that when the colors are evenly distributed, this leads to an optimal situation, and when the balls are not evenly distributed at all, you have a worst case scenario. 
So, when you try to select the balls based on which color has the most balls, you are trying to more evenly distribute the number of balls for each color, and optimize your remaining selections.
A few observations:
(1) Let $r_0$ be the number of remaining balls in the optimal case.  It should be easy to prove that such an $r_0$ exists using the Well Ordering Principle.
(2) There are at most two different colored balls when we end our selections. If there were three colors, we would be able to make an additional selection.
(3) If the remaining number of balls $r$ is such that $r > r_0$, then $r = r_0 + 3n$, where $n$ is an integer and $n > 0$.  This implies that there is a color (I'll call it blue) where if $k$ is the number of selections that contained a blue ball in the set of selections that resulted in $r_0$, there are at most $k - 2$ selections that contain blue balls in the set of selections that resulted in $r$ remaining balls. This may not be obvious, but hopefully you'll see it's true.
Below is an outline of a proof:
We want to prove that if we follow your algorithm, we must have $r_0$ balls remaining.  Suppose the number of balls remaining is $r > r_0$.  This implies that there are an extra two blue balls, so at least two selections do not contain a blue ball.
Suppose the last selection contained no blue balls.  At least one color in the selection had only $1$ ball remaining (otherwise, we would still have $3$ colors with at least one ball). But, we just stated that there were $2$ blue balls remaining, so in this scenario, we did not pick according to your algorithm.  So, the last selection must have contained a blue ball, which implies there were at least 3 blue balls at this point in the selection.
Next, assume the 2nd to last selection has no blue balls.  This means that there are three colors with at least $3$ balls in each color.  If this is the case, at least $3$ additional selections can be made.  But, we just stated that this is the 2nd to last selection, so there must be a blue ball present here as well.  This means the number of blue balls at this point is at least $4$.  We can repeat this argument to show that there cannot be a selection that is missing a blue ball, which leads to a contradiction.  This proves that your algorithm will always result in the lowest number of remaining balls.  
