# A problem involving random walks from Shreve

Problem 5.4i in Shreve examines a symmetric random walk. Let $\tau_2$ be the first time that the random walk reaches 2.

For $\alpha\in (0, 1)$, we are given that $$E [\alpha ^ {\tau_2}] =\sum_{k = 1} ^\infty (\alpha/2) ^ {2k}\frac{(2k)!}{(k+1)!k!}$$

It's clear that

$$E [\alpha ^ {\tau_2}] =\sum_{k = 1} ^\infty (\alpha) ^ {2k} P (\tau_2 = 2k)$$

It's therefore tempting to conclude that

$$P (\tau_2 = 2k)=\frac{(2k)!}{(k+1)!k!}2^{-2k}$$

And indeed that is the answer given. But in general $\sum_i f_i g_i =\sum_i f_i h_i$ does not imply that $g_i = h_i$ and so I'm not sure how we can reach this conclusion. (Asked about specific circumstances where this conclusion is true here.) What am I missing?

It's true that in general if $\sum_i f_i g_i = \sum_i f_i h_i$, we do not automatically have $g_i = h_i$. But this sum is special, because all $f_i$ are monomials (i.e. of the form $\alpha^n$). This makes the sum a power series (of the form $\sum_{n=0}^\infty \alpha^n C_n$), and these series have a lot of nice properties such as continuity and differentiability (with respect to $\alpha$).
$$F(\alpha) = \sum_{n=0}^\infty\alpha^n C_n$$ $$F(\alpha) = \sum_{n=0}^\infty\alpha^n D_n$$
Does this imply $C_n = D_n$? Yes. Yes it does. Precisely because we are dealing with a power series. One way to see this is to think of the series representation as a Taylor series in $\alpha$. The Taylor series is unique, so we automatically have $C_n = D_n = \frac{1}{n!}\frac{\partial^n}{\partial\alpha^n}F\Big|_{\alpha=0}$.
Where does this equality come from? A non-formal proof goes likes this: Take the limit of $\alpha\downarrow 0$. In that case we recover $F(0) = C_0 = D_0$. That proves $C_0 = D_0$. Next, differentiate the series with respect to $\alpha$, and again take the limit of $\alpha$ to zero. This can be done because power series are differentiable. You will then recover that $C_1=D_1$. You now get the trick: to prove that $C_n = D_n$ you differentiate $n$ times and take the limit of $\alpha$ to zero. This proves the equality.