Conditional probability of a random walk hits position $b$ in $n$ steps This question comes from my question Modified gambler's ruin problem: quit when going bankruptcy or losing $k$ dollars in all
Generally, I know the probability that a random walk hits position $b>0$ at step $n$, starting from position $a>0$ is just $\Pr(S_n=b-a)$. But what is the probability if we condition on the fact that the random walk never hits position $0$?
Thank you!
 A: If I understand your problem, you are essentially asking for $ a>0, b > 0 $
\begin{equation*}
\mathbb{P} \bigl( S_0 = a, S_1 > 0, S_2 > 0, \dotsc, S_n = b ).  
\end{equation*}
If this is the requirement, you can use reflection principle. Note that when we are given $ a, b $, then any path from $ (0,a) $ to $ (n,b) $ will have $ (n+b-a)/2 $ many plus steps and $ (n-b+a)/2 $ minus steps and hence the probability of each such path is $ p^{(n+b-a)/2} q^{(n-b+a)/2} $. Now we just require how many such path satisfy the criteria.
For this, we just use the standard reflection principle. The total number paths from $ (0,a) $ to $ (n,b)  $ is given by $ \binom{ n }{ (n+b-a)/2 } $ and the number of paths from $ (0,a) $ to $ (n,b)  $ which touch or cross the $x$-axis is the same as the number of paths from $ (0,-a) $ to $ (n,b)  $, which is given by $ \binom{ n }{ (n+b+a)/2 } $. Thus, the required probability is given by
\begin{equation*}
\biggl[ \binom{ n }{ (n+b-a)/2 } - \binom{ n }{ (n+b+a)/2 }  \biggr]  p^{(n+b-a)/2} q^{(n-b+a)/2}. 
\end{equation*}
