Consider $(X_n)_{n\ge1}$ iid with
$$P(X_1=1)=p,\quad P(X_1=-1)=1-p$$
for some $p\in(0,1)$, $a,b\in\mathbb{Z}$ with $a<0<b$, the sum process $S_n:=\sum_{i=1}^nX_i$ and the stopping time
$$T_{a,b}:=\min\left\{n\ge 1: S_n\in\{a,b\}\right\}.$$
I want to show that
$$P(S_{T_{a,b}}=a)=\frac{1-(\frac{p}{q})^b}{1-(\frac{p}{q})^{b-a}},$$
$$E[T_{a,b}]=\frac{b}{p-q}-\frac{b-a}{p-q}\cdot\frac{1-\left(\frac{p}{q}\right)^b}{1-\left(\frac{p}{q}\right)^{b-a}}.$$
So, I was already able to show the formula for $E[T_{a,b}]$ by using the first result and Wald's identity. This is pretty straight forward, but I am struggling with $P(S_{T_{a,b}}=a)$. I was able to show that $$\left(\frac{q}{p}\right)^{S_n}\text{ and } S_n-n(p-q)$$ are martingales with respect to the filtration $(\mathcal{F}_n)_{n\ge 1}$, $\mathcal{F}_n:=\sigma(S_n)$, but I do not understand how to use this hint. Can someone give me another hint? :)
Thanks in advance!
Sure, here is a hint: Look at your first martingale. You know what the value of it is at 0. What values can it take at the stopping time? (Hint: it can only take two values) What is it's expectation equal to? (Technical note: You need to verify one of the hypotheses of optional stopping theorem here: https://en.wikipedia.org/wiki/Optional_stopping_theorem Your martingale satisfies one of these, and that is enough)