The differential operator on the left is , where . Its repeated characteristic root suggests writing . By the product rule,
so the ordinary differential equation reduces to . Two antiderivatives give
The boundary conditions imply and , hence and . Therefore
The calculation of verifies the ordinary differential equation, and the bracket takes the values one and zero at the two endpoints. These boundary conditions determine both constants uniquely.
Let and denote the first and second labels. Sampling with replacement restores the bag before the second draw, so conditioning on only specifies the threshold. For , there are qualifying green balls and qualifying red balls. For , every green ball and the first red balls qualify. Hence the requested conditional probability is
The formulas agree at and give one at . Labels outside the possible first-draw range do not define a conditioning event of positive probability.
Write . Successive conditional probabilities account for the changing bag under sampling without replacement:
On this event no equality of the two colour counts has occurred, so the game's stopping rule does not interrupt these three draws.

There are unlisted articles, also show them or only show them.