stationary distribution equation I have a question to solve a stationary distribution equation for a DMC. My equations look like this
$$\pi_0 = (1-p)\pi_1$$
$$\pi_1 = \pi_0 + (1-p)\pi_2$$
$$\pi_i = (1-p)\pi_{i+1} + p\pi_{i-1}, 2\le i\le n-1$$
$$\pi_n = \pi_n+p\pi_{n-1}$$
for $0<p<1$. I know as well $\sum \pi_i = 1$. But how can I solve such a system? I've tried to write down some cases but can't see a particular form for a generalization.

EDIT
There has been some confusion in the comments regarding the boundary conditions at $n$, so I want to clarify what I think is going on here:
The relations should be viewed as $\pi_i = F_i(\pi_{i-1},\pi_{i-2}) $ that is, each $\pi_i$ is determined as a function of the two lower $\pi$'s. When the equations are written in that way, we see that the value of $\pi_0$ determines the entire solution. Writing relationships as $\pi_i = G_{i}(\pi_{i+1},\pi_{i-1}) $ is confusing and leads to various contradictions when we try to write both an equation for $\pi_{n-1}$ and $\pi_{n}$.
Bottom line: having both special conditions for $i=0$ and $i=n$ and normalization causes the equations to become over determined ( to make an analogy to a second order ode with 2 boundary conditions and a normalization condition). The $\pi_n$ equation is spurious in my opinion.
END OF EDIT
Start from the recursion for $2\le i \le n-1$:
$$(1-p)\pi_{i+1}-\pi_i +p\pi_{i-1}=0$$ and consider solutions of type $a\lambda^{i}$, solve the quadratic equation to get $\lambda_{+},\lambda_{-}$.
Consider the general solution
$$ \pi_i = a\lambda_{+}^{i}+b\lambda_{-}^{i}$$
and set $a,b$ by using the normalization and the boundary conditions.
