# Frog in the Well [duplicate]

A frog is trapped in a well, just 1 meter below the lip. On sunny days, the well is dry, and the frog is able to climb up 1 meter. On rainy days, the well is wet and the frog slides down 1 meter. If it is rainy 2 out of every 3 days and the well is infinitely deep, what are the frog's chances of ever reaching the lip and escaping?

This is an example of the

Gambler's ruin problem. Here, we consider "escaping the well" as the equivalent of becoming bankrupt, and "never escaping" as the equivalent of becoming infinitely rich.

Using that,

The probability is $$p = \frac{2}{3}$$ and starting position $$i=1$$. We plug this in the formula of $$1 - \Big(\frac{1-p}{p}\Big)^i = 1 - \frac{\frac{1}{3}}{\frac{2}{3}} = \boxed{\frac{1}{2}}$$.

• Haven't seen this version of the problem before, nice! To me it's a neat paradox that the frog has a chance of never escaping, but will never have no chance of escaping. Commented May 20, 2020 at 17:56
• I just spent about 30 minutes writing out the P(x) equations for each meter and doing a convergence sum. I was about to post my answer and then I saw this and how simple it was lol Commented May 20, 2020 at 18:02
• @Ankit, The solution you mentioned is included in the proof, so you are doing the right way. It is just that it already has a name (I was not familiar with this name before, too) Commented May 21, 2020 at 6:14
• @justhalf Lol yeah I got 1/2 as well, I'm just saying that I spent so much time on a problem that takes 2 minutes lol. Commented May 21, 2020 at 19:04
• I'm still having trouble wrapping my head around this. How could it be that there's a 50% chance the frog won't escape when the only way the situation ends is when the frog escapes? The situation should theoretically go on forever until the frog escapes, why is there ever a chance the frog won't escape? Commented Jun 27, 2020 at 17:02