With $X_i$ i.i.d. random variables, with $\mathbb{P}(X_i=1)=1/2=\mathbb{P}(X_i=-1)$. $S_n=\sum_{i=1}^n X_i$.
Now given $a<0<b$ integers, the martingale $S_n$ stops at time: $$\tau=\inf\{k\geq1:S_k\in\{a,b\}\}$$
I need to calculate the distribution of $S_\tau$, can someone help me with this? I know that the chance that $a$ gets hit before $b$ is $\frac{b}{a+b}$.
Hitting $a$ before $b$ means that $S_{\tau}=a$. Since you already know that the probability for this event is $b/(a+b)$, we have
$$\mathbb{P}(S_{\tau} = a)= \frac{b}{a+b}.$$
On the other hand, we also know that $\mathbb{P}(S_{\tau} \in \{a,b\})=1$. Hence,
$$\mathbb{P}(S_{\tau}=b) = 1- \mathbb{P}(S_{\tau}=a) = \frac{a}{a+b}.$$
Consequently, the distribution of $S_{\tau}$ is given by
$$\frac{b}{a+b} \delta_a + \frac{a}{a+b} \delta_b$$
where $\delta_x$ denotes the Dirac measure at $x$.