Given a one dimensional random walk where I have $p$ probability to go forward and $q$ probability to go backwards.
I have to prove that, starting from the origin, the probability of reaching $a>0$ before returning to the origin is $p(1-q_1)$
Where
$$q_1=\frac{\left(\frac{q}{p}\right)^a-\left(\frac{q}{p}\right)}{\left(\frac{q}{p}\right)^a-1}$$
After what Ian's response.
Ian (https://math.stackexchange.com/users/83396/ian), Probability to reach $a>0$ before returning to the origin in a one dimensional random walk., URL (version: 2021-03-25): https://math.stackexchange.com/q/4076368
I thought that there was a paralelism between this problem and the gambler's ruin:
Let player A have a capital of $z$ and player B have a capital of $b$. If we define $a=z+b$. And the probability for the player A to win the game is A and the probability for player B to win the game is q. We know that the probability for player A to lose all his money is:
if $p\neq q$
$$q_z=\frac{\left(\frac{q}{p}\right)^a-\left(\frac{q}{p}\right)^z}{\left(\frac{q}{p}\right)^a-1}$$ if $p=q$ $$q_z=1-\frac{z}{a} $$
So in our model we need to redefine the $p_0$ because in the gambler's ruin it's $0$ (If you don't have money you can't gamble). But in our game we can actually go forward with a probability of $p%$.
In order to achieve the point $a$ you first have to start from the point $z=1$ for the probability to be defined in the gambler's ruin model. So, as Ian said, we need to go forward with a probability of $p$. Once we are in $z=1$, we can apply the gambler's ruin model so we have a probability of $p_1$ to reach $a$.
Finally we multiply all this two probabilities and we have the probability to reach $a$ starting from $0$. $$pp_1=p(1-q_1)$$