2 deleted 28 characters in body

Ori Gurel-Gurervich's comment suggests a very simple way to use a martingale (an example of a Wald martingale) to evaluate the final question in which the probability of gaining a dollar is $p \ne \frac12$.

If $m(t)$ is how much money you have at time $t$, then $m(t)$ is not a martingale for $p \ne \frac12$ when you haven't stopped yet. frac12$. However, for the right base$C$,$C^{m(t)}$is a martingale:$E (C^{m(t+1)}) = E(C^{m(t)})$. That means we can use the same argument that the starting value of a martingale is the average of the stopping values to compute the probabilities of ending at$0$or$y$, or even of escaping to$\infty$, \infty$ (with a bit more technical workwork).

The right value of $C$ is $(1-p)/p$. You start at $C^x$ and end at $C^y$ or $C^0 = 1$, so if you finish with probability 1 (easy to prove with another martingale) you end up at $C^y$ with probability $(1-C^x)/(1-C^y)$, and you end up at $C^0$ with the complementary probability $(C^x-C^y)/(1-C^y)$.

When $p \sim \frac12$, $C^x \sim 1- x \epsilon$ and $C^y \sim 1-y\epsilon$, which is continuous with the case $p=\frac12$.

If you don't stop at $y$, the probability that you escape to $\infty$ is $0$ if $p \le 1/2$ and $1-C^x$ if $p \gt 1/2$, which makes the probability of ruin $C^x$.

1

Ori Gurel-Gurervich's comment suggests a very simple way to use a martingale (an example of a Wald martingale) to evaluate the final question in which the probability of gaining a dollar is $p \ne \frac12$.

If $m(t)$ is how much money you have at time $t$, then $m(t)$ is not a martingale for $p \ne \frac12$ when you haven't stopped yet. However, for the right base $C$, $C^{m(t)}$ is a martingale: $E (C^{m(t+1)}) = E(C^{m(t)})$. That means we can use the same argument that the starting value of a martingale is the average of the stopping values to compute the probabilities of ending at $0$ or $y$, or even of escaping to $\infty$, with a bit more technical work.

The right value of $C$ is $(1-p)/p$. You start at $C^x$ and end at $C^y$ or $C^0 = 1$, so if you finish with probability 1 (easy to prove with another martingale) you end up at $C^y$ with probability $(1-C^x)/(1-C^y)$, and you end up at $C^0$ with the complementary probability $(C^x-C^y)/(1-C^y)$.

When $p \sim \frac12$, $C^x \sim 1- x \epsilon$ and $C^y \sim 1-y\epsilon$, which is continuous with the case $p=\frac12$.

If you don't stop at $y$, the probability that you escape to $\infty$ is $0$ if $p \le 1/2$ and $1-C^x$ if $p \gt 1/2$, which makes the probability of ruin $C^x$.