Definition. Consider a sequence of independent, identically distributed (i.i.d.) random variables $X_{1}, X_{2}, \ldots$ with $\mathbb{P}\left(X_{k}=1\right)=p \text { and } \mathbb{P}\left(X_{k}=-1\right)=q $ where $p, q \in(0,1), p+q=1, \text { and } p \neq q .$ Define $S_{n}=S_0+\sum_{k=1}^{n} X_{k} .$ Then, the stochastic process $S=\left\{S_{n} \mid n \in \mathbb{N}_{0}\right\}$ is known as an asymmetric random walk.
Now,let $S_{0}=0, 0<p<q<1$,define $$\tau_{i}:=\inf\left\{n\ge 1\mid S_{n}=i\right\},i\in \mathbb{Z}.$$ Then $\tau_{i}$ is a stopping time.
Show the value of $\mathbb{E}(\tau_{i}\mid \tau_{i}<\infty),$ when $i\in \left\{0,1,2,\cdots\right\}.$
I know that $$\mathbb P\left(\tau_{i}<\infty\right)=\left\{\begin{array}{cl}(p / q)^{i} & \text { if } i \in \mathbb{Z}^{+} \\ 1 & \text { if } i \in \mathbb{Z}^{-} \end{array}\right. .$$
Since $\left\{S_n-\mu n:n\in\mathbb{Z}^{+} \right\}$(where $\mu=\mathbb{E}{X_1}=p-q$) is a martingale, for any fixed $i\in \mathbb{Z},\left\{S_{\tau_{i}\wedge n}-(p-q)(\tau_{i}\wedge n):n\in\mathbb{Z}^{+} \right\}$ is also a martingale.So $\mathbb{E}[S_{\tau_{i}\wedge n}-(p-q)(\tau_{i}\wedge n)]=\mathbb{E}(S_0)=0$ for $n\in \mathbb{Z}^{+}.$
Considering any fixed $i \in \mathbb{Z}^{-},\mathbb{P}(\tau_i<\infty)=1$ implies $\displaystyle \lim_{ n\to \infty}[S_{\tau_{i}\wedge n}-(p-q)(\tau_{i}\wedge n)]\stackrel{\mathrm{a.s.}}{=}S_{\tau_{i}}-(p-q)\tau_{i}$ and $|S_{\tau_{i}\wedge n}-(p-q)(\tau_{i}\wedge n)|\le |i|+|p-q|\tau_i$ implies that $\displaystyle \lim_{ n\to \infty}\mathbb{E}[S_{\tau_{i}\wedge n}-(p-q)(\tau_{i}\wedge n)]=\mathbb{E}[S_{\tau_{i}}-(p-q)\tau_{i}]$ by the Bounded Convergence Theorem.Then $\mathbb{E}[S_{\tau_{i}}-(p-q)\tau_{i}]=0\Rightarrow \mathbb{E}(\tau_i\mid \tau_i<\infty)= \mathbb{E}(\tau_i)=\frac{i}{p-q}.$
For the situation $i\in \left\{0,1,2,\cdots\right\}$, the above method doesn't come into play.Perhaps we need to employ some properties of Markov chains, but I haven't yet found a solution strategy.
Fix $s \in ]0,1[$ and $z>1$. For every $n \ge 0$, set $M_n = s^n z^{S_n}$ and $\mathcal{F}_n = \sigma(X_1,\ldots,X_n)$.
Writing $M_{n+1} = s^{n+1} z^{S_n}z^{X_{n+1}}$, one checks that $\mathbb{E}[M_{n+1}|\mathcal{F}_n] = s^{n+1} z^{S_n}(pz+qz^{-1})$. We derive that $(M_n)_{n \ge 0}$ is a martingale in $(\mathcal{F}_n)_{n \ge 0}$ if and only if $pz+qz^{-1}=s^{-1}$. The study of the function $z \mapsto pz+qz^{-1}$ shows that this equation has a unique solution $z(s) \in ]q/p,+\infty[$. We fix $z=z(s)$ in what follows.
Given $i \ge 0$, the positive martingale $(M_{\tau_i \wedge n})_{n \ge 0}$ is bounded above by $z(s)^i$, and converges almost surely to $s^{\tau_i}z(s)^i\mathbb{1}_{[\tau_i<+\infty]}$. Hence the convergence holds also in $L^1$ and $$\mathbb{E}[s^{\tau_i}z(s)^i\mathbb{1}_{[\tau_i<+\infty]}] = \mathbb{E}[M_0] = 1.$$ As a result we obtain the generating function of $\tau_i$: $$G(s) := \mathbb{E}[s^{\tau_i}\mathbb{1}_{[\tau_i<+\infty]}] = z(s)^{-i}.$$ When $s \to 1-$, $z(s) \to z(1-) = q/p$ and $(z(1-)-z(s))/(1-s)$ has a finite limit which can be computed.
By monotone convergence, we derive $$\mathbb{P}[\tau_i<+\infty] = z(1)^{-i}.$$ and $$\mathbb{E}[\tau_i\mathbb{1}_{[\tau_i<+\infty]}] = \lim_{s \to 1-}\mathbb{E}\Big[\frac{1-s^{\tau_i}}{1-s}\mathbb{1}_{[\tau_i<+\infty]}\Big] = \lim_{s \to 1-} \frac{z(1-)^{-i}-z(s)^{-i}}{1-s} = -iz(1-)^{-i-1}\lim_{s \to 1-} \frac{z(1-)-z(s)}{1-s}.$$ It remains to compute the limit above.