I don't understand 2 steps of the solution to a gambler's ruin exercise.
set-up for the gambler's ruin problem:
$(X_n)_{n\geq 1}$ are i.i.d. rv with $P(X_1=1)=1-P(X_1=-1)=p$ and $p\in (0,1),\ p\neq 1/2$. We have integers $0
Exercises
Deduce the value of $P(S_T=0)$ and $P(S_T=b)$
Compute $E(T)$
I had to show that the following two are martingales, so this is known: $$M_n:=\left(\frac{1-p}{p}\right)^{S_n}\qquad N_n:=S_n -n(2p-1)$$
The solutions says this:
- The stopped Martingales $M_T$ and $N_T$ are bounded, thus uniformely integrable with terminal value $M_T$ and $N_T$. As a consequence: $$\left(\frac{1-p}{p}\right)^{a}=P(S_T=b)\left(\frac{1-p}{p}\right)^{b}+(1-P(S_T=b))\left(\frac{1-p}{p}\right)^{0}$$
I don't understand this equation. I understand that $E(M_T)=E(M_0)=\left(\frac{1-p}{p}\right)^{a}$ and it also makes sense that $S_T$ is either $b$ or $0$. But I don't understand why this $M_T$ is Bernoulli distributed with these parameters. Can someone explain?
- $E(N_T)=a$ that is $E(S_T)-(2p-1)E(T)=a$. We deduce: $$E(T)=\frac{\left(\frac{\left(\frac{1-p}{p}\right)^{a}-1}{\left(\frac{1-p}{p}\right)^{b}-1}\right)b-a}{(2p-1)}$$
I don't see why $$E(S_T)=\left(\frac{\left(\frac{1-p}{p}\right)^{a}-1}{\left(\frac{1-p}{p}\right)^{b}-1}\right)b$$