In each of the following cases determine whether the stochastic matrix P, which you may assume is irreducible, is reversible:
$ \begin{pmatrix} 0 & p & 1-p\\ 1-p & 0 & p\\ p & 1-p & 0 \end{pmatrix} $
So I am stuck with the following system of equations.
$ \pi_1p = \pi_2(1-p) \\ \pi_1(1-p) = \pi_3p \\ \pi_2p = \pi_3(1-p) \\ \pi_1 + \pi_2 + \pi_3 = 1 $
I think I used all possibilities but never my answer comes to the one provided:
$ \pi_1 = \frac{1}{1+p/(1-p) + (1-p) + p^2/(1-p)} \\ \pi_2 = \frac{p/(1-p)}{1+p/(1-p) + (1-p) + p^2/(1-p)} \\ \pi_3 = \frac{1-p+p^2/(1-p)}{1+p/(1-p) + (1-p) + p^2/(1-p)} $
Important factor is that p could be 0 (I think...). Could someone point me to the right path so that I get the provided answer? Also when I solve it myself my solutions somehow fail to fulfill the condition that all $\pi$ should sum up to one even though I use this property to solve the equation. What I am doing is first I substitute one of variables say $\pi_1$ with $\pi_1 = 1 - \pi_2 - \pi_3$ in both equations where it appears and then I try to substitute one of $\pi_2$ or $\pi_3$ with other equation. Basically I am stuck with high school math, any direction to unstuck me would be highly appreciated!
One of my attempts:
$ \pi_1p = \pi_2(1-p) \\ \pi_1(1-p) = \pi_3p \\ \pi_2p = \pi_3(1-p) \\ \pi_1 + \pi_2 + \pi_3 = 1 \\ $
$ (1-\pi_2-\pi_3)p = (1-p)\pi_2 \\ (1-\pi_2-\pi_3)(1-p) = \pi_3p \\ \pi_2p = \pi_3(1-p) \\ $
$ p-\pi_2p-\pi_3p = \pi_2-\pi_2p \\ 1-\pi_2-\pi_3-p+\pi_2p+\pi_3p = \pi_3p \\ \pi_2p = \pi_3(1-p) \\ $
$ p-\pi_3p = \pi_2 \\ 1-\pi_2-\pi_3-p+\pi_2p = 0 \\ \pi_2p = \pi_3(1-p) \\ $
$ p-\pi_3p = \pi_2 \\ 1-p+\pi_2p-\pi_2-\pi_3 = 0 \\ \pi_2p = \pi_3(1-p) \\ $
$ p-\pi_3p = \pi_2 \\ 1-p+\pi_2(p-1)-\pi_3 = 0 \\ \pi_2p = \pi_3(1-p) \\ $
$ p-\pi_3p = \pi_2 \\ \pi_2(p-1) = p-1+\pi_3 \\ \pi_2p = \pi_3(1-p) \\ $
$ (p-\pi_3p)(p-1) = p-1+\pi_3 \\ (p-\pi_3p)p = \pi_3(1-p) \\ $
$ \pi_3(1-p)-(p-\pi_3p) = p-1+\pi_3 \\ $
$ p = \frac{1}{2} \\ $
But answer remains a mystery