I have troubles understanding the solution for the following exercise. It's about markov chain, but the part I don't understand is rather algebraic and about a recurrence system.
Exercise: Let $p \in ]0,1[$ and $(X_n)_{n\geq 0}$ be a Markov chain on $E=\{a,b,c\}$ with transition Matrix $$Q:=\begin{pmatrix}1-p &p &0\\1/2&0&1/2\\0&0&1 \end{pmatrix}$$ Compute the probabillity $P(X_n=b\mid X_0=a),\ n\in\mathbb{N}$ and find it's limit for $n\to \infty$
Solution: The graph looks like this:
First notice $Q_n=Q\cdot Q_{n-1}\quad \forall n\geq 1$. In particular $a_n:=P(X_n=b\mid X_0=a)$ and $b_n:=P(X_n=b\mid X_0=b)$ then $$\begin{cases}a_n=(1-p)a_{n-1}+pb_{n-1}\\ b_n=\frac{1}{2}a_{n-1}\end{cases}$$ Thus $(a_n)_{n\geq 0}$ is $$\begin{cases}a_n-(1-p)a_{n-1}-\frac{p}{2}a_{n-2}=0,\quad n\geq 2,\\ a_0=0,\ a_1=p\end{cases}$$
Here is the part I don't understand. I have no clue how to solve this recurrence system. I've never did this before.
Solution: Hence $$a_n=p\frac{(1-p+\sqrt{1+p^2})^n-(1-p-\sqrt{1+p^2})^n}{2^n\sqrt{1+p^2}}$$ And find $a_n\to 0$.
How do I get to that result? I tried $$a_n-(1-p)a_{n-1}-\frac{p}{2}a_{n-2}=a_n-(1-p)a_{n-1}-\frac{p}{2}\left((1-p)a_{n-2}-\frac{p}{2}a_{n-3}\right)=0$$ But I fail miserably. (I also find the solution quite not so "probabilistic", is this the only possible way to compute this?)
