Hitting set expected value Let's consider variable that satisfies $P(X_i=1)=P(X_i=-1)=\frac12$  and define $\tau_k=\inf\{n : |S_n|=k\}$. I want to calculate $E[\tau_k]$.
I thought it would be good to hit this with wolds decomposition : $$E[S_\tau]=E[\tau_k] E[X_1]$$
But $S_\tau$ can be either $k$ or $-k$ with equal probability so $E[S_\tau]=0$ as well as $E[X_1]$. It seems that I have equality $0=0$ which is meaningless. Is there any simple way how can I calculate $E[\tau_k] $ ?
 A: Why don't you consider the martingale $( n-S_n^2 ; n \ge 1 )$
Update
Firstly, by any mean possible, you can prove that :
$$\mathbb{P}( \tau < +\infty) =1$$
(Mine is CLT, but if you can find a better approach for that, I'd be happy to get informed)
So now, let's consider the stopped martingale $(M_n) := ( n \wedge \tau -S_{n\wedge \tau }^2$  )
We see that:

*

*$\lim_{n \rightarrow +\infty} \tau \wedge n = \tau \text{ a.e}$ (as $\mathbb{P}( \tau <+\infty) =1$ ).
So $\lim_{n \rightarrow+ \infty} \mathbb{E}( \tau\wedge n ) =\mathbb{E}( \tau )$ ( monotone convergence)

*$\lim_{n \rightarrow +\infty} S^2_{n \wedge \tau } =  S^2_{ \tau }=k^2 $ ( also because $\tau$ is finite a.s).
Thus $\lim_{n \rightarrow+ \infty} \mathbb{E}( S^2_{\tau\wedge n} ) =k^2$( Dominated Convergence)
Besides, $M_n$ is a martingale, then. $\mathbb{E} (M_n) = M_0=0$.
So,
$$ 0 = \lim_{n \rightarrow \infty} \mathbb{E}(M_n) =\lim_{n \rightarrow \infty} \left( \mathbb{E}(n\wedge\tau)-  \mathbb{E}(S^2_{n\wedge\tau}) \right) =\mathbb{E}(\tau) -k^2$$
Conclusion,
$$ \mathbb{E}(\tau) =k^2$$
