I am studying a random walk on 1D and I am able to derive the probability mass function for the position of the walker $n$ to be a binomial distribution of the form: \begin{equation} p_n(k)=\frac{n!}{\left(\frac{n+k}{2}\right)!\left(\frac{n-k}{2}\right)!}\left(p(1-p)\right)^{n/2}\left(\frac{p}{1-p}\right)^{k/2} \end{equation} where $p$ is the probability that the walker will make a step to the right $(+1)$ and $1-p$ the probability that he will make a step to the left $(-1)$. What I am not able to do thought is to prove that the stationary distribution of the random walker, will be a uniform distribution.
I have tried to use the so called balance equation for the stationary distribution: \begin{equation} \pi=\pi P \end{equation} where if I am not mistaken the transition probability matrix has to be: \begin{equation} P=\begin{bmatrix} 0 & p & 1-p \\ 1-p & 0 & p & \\ p & 1-p & 0 \end{bmatrix} \end{equation} Could someone help me prove that eventually $\pi=1/L$, where $L$ is the number of the possible states of the walker? The number of states that I start with is $L=3$ and then I could see how this could generalize to $L \leq \infty$.
Your transition matrix is incorrect: it should be of dimension $L\times L$, and the first row should be $[0,p,0,0,...,1-p]$, the second $[1-p, 0, p, 0, ..., 0]$, the second last $[0,...,0,1-p,0,p]$, and the last $[p, 0, ..., 1-p,0]$.
Thus the balance equations are:
$$ \pi_1 = \pi_Lp + \pi_2(1-p) \\ \pi_k = \pi_{k-1}p + \pi_{k+1}(1-p) \\ \pi_L = \pi_{L-1}p + \pi_1(1-p) $$
for $k \in \{2,...,L-1\}$
This is a linear system, and $\pi_1=\pi_2=...=\pi_{L-1}=\pi_L$ is a solution. Therefore $\pi_i = \frac1L$ for all $i \in {1,...,L}$.
We used the fact that this RW has a finite state space and all states communicate, which implies the stationary distribution is unique, i.e. only one solution to the above linear system exists.