Theorem: Let $X_{n}$ be a Markov chain with transition probability p and let $f\left ( x,n \right )$ be a function of the state x and the time n so that $f\left ( x,n \right )=\sum_{y \in Y}{}p\left ( x,y \right )f\left ( y,n+1 \right )$. Then $M_{n}=f\left ( X_{n},n \right )$ is a Martingale with respect to $X_{n}$. In particular, if $h\left ( x \right )=\sum_{y \in Y}{}p\left ( x,y \right )h\left ( y \right )$, then $h\left ( X_{n} \right )$ is a martingale.
Question:
Let $Y_{1},\cdot \cdot \cdot$ be independent with $P\left ( Y_{i}=1 \right )=P\left ( Y_{i}=-1 \right )=\frac{1}{2}$ and let $X_{n}=X_{0}+Y_{1}+\cdot \cdot \cdot +Y_{n}$. Then, $M_{n}=X_{n}^{2}-n$ is a Martingale wrt $X_{n}$
Attempt:
Let $f\left ( x,n \right )=x^{2}-n=h\left ( x \right )$.
It suffices to show that $\sum{y \in Y}{}p\left ( x,y \right )h\left ( y \right ) =x^{2}-n$ by the theorem.
Now,
$p\left ( x,y \right )=\begin{Bmatrix} \frac{1}{2} &y=x+1 & \\ \frac{1}{2}& y=x-1 & \\ 0 &y\neq x-1 , y\not\neq x+1 & \end{Bmatrix}$
so
$\sum_{y \in Y}{}p\left ( x,y \right )h\left ( y \right ) =\frac{1}{2}\left ( x+1 \right )^{2}-n+\frac{1}{2}\left ( x-1 \right )^{2}-n$
author's attempt:
Why does the author's attempt differs from mine?
I'm puzzled.
