For a Markov process with state space $S= \{ 0,1,2,\dots\}$
The one step probabilities are: $p_{0,0}=q$, $ p_{0,2}=p$ and $p_{i,i-1}=q$, $ p_{i,i+1}=p$ for $i \geq1$ where $p+q=1$.
The one step transition matrix is below. What is the stationary distribution? \begin{bmatrix} q & 0 &p & & \\ q & 0 & p & & \\ & q & 0 & p & \\ & & q & 0 & p \\ & & & \ddots & \ddots & \ddots \end{bmatrix}
Let {$\mathcal{\pi_{0}}, \mathcal{\pi_{1}}, ...$} be the stationary distribution.
$\mathcal{\pi_{1}}= \frac{p }{q}\pi_{0}$
$\mathcal{\pi_{2}}= \frac{p }{q^2}\pi_{0}$
$\mathcal{\pi_{3}}= \frac{p-p^2 q-pq^2 }{q^3}\pi_{0}$
$\mathcal{\pi_{4}}= \frac{p-2p^2 q-pq^2 }{q^4}\pi_{0}$
$\mathcal{\pi_{5}}$ onward becomes a mess.
Does the process have a stationary distribution? If so, what is it?
Don't begin by writing everything in terms of $\pi_0$. The first few terms are complicated, but for $n\geq 3$ we have the regular pattern $p\pi_{n-1}+q\pi_{n+1}=\pi_n$ which can be rewritten $p(\pi_{n-1}-\pi_n)=q(\pi_{n}-\pi_{n+1})$. By induction, $$\pi_n-\pi_{n+1}=\left({p\over q}\right)^{n-2}(\pi_2-\pi_3),$$ and therefore $$\pi_2-\pi_{n}=\sum_{j=2}^{n-1}\left({p\over q}\right)^{j-2}(\pi_2-\pi_3).$$ You can now use your formulas to rewrite $\pi_n$ in terms of $\pi_0$ and get the answer. In particular, you should discover that $\pi_n$ is summable, and the chain is recurrent, only if $q>p.$