I was really interested in this question here
What is the expected number of red apples left when all the green apples are picked?
We have 4 green apples and 60 red apples. Each time we pick one out without replacement. Then what is the expected number of red apples left when all 4 green apples are picked?
I tried to use generating functions to get a closed form. I wrote a recurrence for the expected number of red apples like this (and I've verified that it is correct):
$$E(r,g) = \frac{r}{r+g}E(r-1,g) + \frac{g}{r+g}E(r,g-1)$$
and $E(0,g) = 0$ and $E(r,0) = r$.
So I did this
$$G(x) = \sum_{r=0}^{\infty} \sum_{g=0}^{\infty} E(r,g) x^r y^g$$
and tried expanding it out and shifting indices and taking derivatives but it was a huge mess and I had no confidence in what I was doing. Can generating functions be used here to get the closed form $E(r,g) = \frac{r}{g+1}$? I noticed this pattern by inspection and used induction to prove that the closed form was correct, but I wanted to know how to actually derive it using generating functions.
[2016-08-13]: A different way to proceed from the PDE in (5), independent of other answers is stated here. Coefficient extraction added at the end of this answer.
OPs recurrence relation is fine (if we additionally specify the range of validity) and we can derive a generating function from it.
In the following we consider each term of the recurrence relation separately. It is also convenient to use the differential operator $D_x:= \frac{d}{dx}$ and $D_y:=\frac{d}{dy}$.
Comment:
In (2) we have to respect the validity of the recurrence relation and start with $r=g=1$ accordingly
In (3) we use the operator $(xD_x)$ to transform a series $\sum_{r=1}^\infty a_r x^r$ to $\sum_{r=1}^\infty r a_r x^r$
In (4) we use the linearity of the differential operator and since the geometric series is a function in $x$ the operator $yD_y$ transforms it to $0$.
Now we consider the the first summand of the RHS of (1).
and now the other summand of the RHS of (1).
Putting all three expressions together we obtain
We see $G(x,y)$ fulfills a linear differential equation in two variables. Please find here a different way to proceed. But in fact we need not necessarily try to solve it, since we already know from @MarkoRiedels answer: \begin{align*} E(r,g)=\frac{r}{g+1} \end{align*}
In order to determine the integration constant $C$ we evaluate $G(x,y)$ at $\left(\frac{1}{2},\frac{1}{2}\right)$.
[Update 2016-08-13]: According to OPs comments we extract the coefficient $E(r,g)$ from $G(x,y)$.
In order to do so, it's convenient to use the coefficient of operator $[x^r]$ to denote the coefficient of $x^r$ in a series $A(x)$.
Comment:
In (1) we use the rule $[x^p]x^qA(x)=[x^{p-q}]A(x)$.
In (2) we apply the binomial series expansion and the use the series representation of $\ln(1-y)$.
In (3) we select the coefficient of $y^{g+1}$ and use the binomial identity $\binom{-p}{q}=\binom{p+q-1}{p-1}(-1)^q$.
In (4) we select the coefficient of $x^{r-1}$.