Gambler's Ruin with unfair coin I was solving this famous problem which reads:

You start with N Dollars.
Each turn, you toss a coin for each dollar you have and you double it if you win, otherwise, you lose it. You go on like this.
What is the probability of losing all of your money?

You solve the problem in the following way:

*

*You notice that, $$P(\text{Ruin having N dollars}) = (P(\text{ruin having 1 dollar}))^N$$


*calling $ e:= P(\text{ruin having 1 dollar}) $  you set the recursive expression
$$
e = p_l + p_w e^2 
$$
in which $p_l$ is the probability of losing and $p_w$ is the probability of winning (so that, you have now two coins and you have to lose both of them).


*Setting $p_l = p_w = 1/2$ one has $e = 1$, which means that if you play this game forever you will lose eventually.

This is a standard problem and it is pretty famous.
I wanted to generalize the problem for unfair coins. In particular, I wanted to find the value of $p_w$ for which the probability $e$ is not zero.
So, I solved the equation for general $p_w$ and $p_l = 1 - p_w$ and what you get is that you always have two solutions, namely:
$$
e_1 = \frac{p_l}{p_w};  \quad e_2 = 1
$$

*

*When $p_w <1/2$, $e_1$ is larger than $1$: we can exclude this solution because it is not in $(0,1)$, the valid range for probability. We still have $1$ as a solution, which implies that we will always lose for all of our money.


*But when $p_w > 1/2$, $e_1$ is in (0,1), meaning that it is an acceptable solution. In fact, for $p_w=1$ you got $e_1=0$, according with the intuition. The trouble is that $e_2$ is still a valid solution.
Is this correct? And should we interpret the fact that we have two valid solutions in that regime, one of which leads to certain ruin?
 A: You got that if $e$ is probability of ruin having $1$ dollar, then it satisfies your equation. It doesn't mean that any $e$ that satisfies this equation is probability of ruin. Extreme case: this probability also satisfy equation $e = e$, but clearly not all solutions of this equation are probabilities of ruin.
To see that $e \neq 1$ if $p_w > \frac{1}{2}$, we probably need some limit theorems. For simplicity, assume we bet on one dollar at a time (given sequence of coin flips, it lead to the same result of ruining or not).
Let $\overline X_n$ be fraction of wins after $n$ flips. Strong law of big numbers say that $P(\lim\limits_{n \to \infty} \overline X_n = p_w) = 1$. From definition of limit it implies that for some $N$, $P(\exists n > N: \overline X_n < \frac{1}{2}) < 1$.
Obviously we can get to $2N$ dollars with non-zero probability. After that, we have non-zero probability of never losing more than half times except may be in the next $N$ flips, which isn't going to ruin us. So, there is non-zero probability of never losing all our money, and so $e \neq 1$.
A: While looking at the wikipedia page for gambler's ruin, I actually saw that there is a section on unfair coin flipping,. It returns undefined when I plug in a fair coin ($\frac{0}{0}$), but if I plug in an only very slightly unfair coin, p=0.50001,q=0.49999, I get $P_1=0.50004$, or just $0.00004$ off from a fair coin which scans.
\begin{aligned}P_{1}&={\frac {1-({\frac {p}{q}})^{n_{2}}}{1-({\frac {p}{q}})^{n_{1}+n_{2}}}}\\[5pt]P_{2}&={\frac {1-({\frac {q}{p}})^{n_{1}}}{1-({\frac {q}{p}})^{n_{1}+n_{2}}}}\end{aligned}
