# Martingales and random walk

Suppose jumps $X_1,X_2,....$ of a simple random walk and i.i.d distributed having beroulli random variables i.e

$P(X_1 = 1) = p ; P(X_1 = -1) = 1-p = q$

Random walk is the process ${[Y_n, n\ge0}]$ where $Y_0 = 0$ and $Y_n = Y_{n-1} + X_n$

I now have to show that the process $Y_n - n(p-q)$ is a martingale with respect to $[X_n, n=1,2,....]$

I started with the usual show that:

$E[Y_{n+1} - (n+1)(p-q)|X_1, X_2,.....,X_n] = Y_n -n(p-q)$

and i did this as follows:

$E[Y_{n+1} - (n+1)(p-q)|X_1, X_2,.....,X_n] = E[Y_{n+1}|X_1,...,X_n] -(n+1)(p-q)$

$= E[Y_n + X_{n+1}|X_1,...,X_n] -(n+1)(p-q)$

$=E[Y_n|X_1,...,X_n] + E[X_{n+1}] -(n+1)(p-q)$

$=Y_n +(1*p) + (-1*q) - (n+1)(p-q)$

$=Y_n - n(p-q)$

Which is the correct reslut, but i am not sure that my steps are correct. Mainly I am not 100% sure that $E[Y_n|X_1,...,X_n]$is really equal to $Y_n$.

Any help or tips?

To prove that a sequence is a martingale you first need to say with respect of what filtration it happens. Since you are going to calculate conditional expectations you also need to prove that the variables are integrable. About your specific doubt, $E[Y_n|X_1, \cdots, X_n]=Y_n$ because $Y_n$ is a function of $X_1, \cdots, X_n$ (you also need to remember the definition of conditional expectation, it is also important to you to recognize where you used the independence of $(X_i)_i$) and the remaining proof seems correct to me.
Let $M_n = Y_n-n(p-q)$. First note that
\begin{align} \mathbb E[|M_n|] &= \mathbb E[|Y_n-n(p-q)|]\\ &\leqslant \mathbb E[|Y_n|] + n|p-q|\\ &\leqslant n + n\\ &=2n<\infty, \end{align} so that the $M_n$ are integrable. Let $\{\mathcal F_n\}$ be the natural filtration of $\{X_n\}$, that is, $$\mathcal F_n = \sigma\left(\bigcup_{i=1}^n \sigma(X_i) \right).$$ For each nonnegative integer $n$, we have \begin{align} \mathbb E[M_{n+1}\mid\mathcal F_n] &= \mathbb E[Y_{n+1}-(n+1)(p-q)\mid\mathcal F_n]\\ &= \mathbb E[Y_n - n(p-q) +X_{n+1} - (p-q)\mid\mathcal F_n]\\ &= \mathbb E[Y_n - n(p-q)\mid\mathcal F_n] + \mathbb E[X_{n+1}-(p-q)\mid\mathcal F_n]\\ &= \mathbb E[M_n\mid\mathcal F_n] + \mathbb E[X_{n+1}] - (p-q)\\ &= M_n, \end{align} so that $\{M_n\}$ is a martingale with respect to $\{\mathcal F_n\}$.