Let , , and be the events that the -th drawn ball is red, green or blue respectively. Let be the event that a green ball is drawn before a blue ball.
Note that if a red ball is drawn, it is placed back, as if the experiment never happened. Draws continue until a green or a blue ball is drawn. The red balls are irrelevant in the experiment. Thus, the problem reduces to removing all the red balls, and finding the probability of the first, randomly drawn ball being green.
Thus,
Thus,