I have the following transition matrix $P$
\begin{equation} P= \begin{pmatrix} 1/2 & 1/3 & 1/6\\ 1/4 & 3/4 & 0\\ 1/5 & 2/5 & 2/5 \end{pmatrix} \end{equation}
I have tried to calculate the stationary matrix as \begin{equation} P^n= C D^n C^{-1} \end{equation}
With $D=C^{-1} P C$ the diagonal matrix. Calculating $C$ with the eigenvalues and eigenvectors
\begin{equation} C= \begin{pmatrix} v_1 & w_1 & z_1\\ v_2 & w_2 & z_2\\ v_3 & w_3 & z_3 \end{pmatrix} \end{equation}
where the eigenvectors are
\begin{align} \vec{v} =\langle (v_1,v_2,v_3)\rangle &= \langle(1,1,1)\rangle \\ \vec{w} =\langle(w_1,w_2,w_3)\rangle &= \langle\left(\frac{2i\sqrt{39}+3}{6},\frac{-3i\sqrt{39}-7}{16},1\right)\rangle \\ \vec{v} =\langle(v_1,v_2,v_3)\rangle &= \langle\left(\frac{-2i\sqrt{39}+3}{6},\frac{3i\sqrt{39}-7}{16},1\right)\rangle \\ \end{align}
so the diagonal matrix is \begin{equation} D= \begin{pmatrix} 1 & 0 & 0\\ 0 & \frac{-i\sqrt{39}+39}{120} & 0\\ 0 & 0 & \frac{i\sqrt{39}+39}{120} \end{pmatrix} \end{equation}
how can i calculate $D^{n}$? is the diagonalization correct?
I tried by other way using $BP=B$ where B is the final vector state, then
\begin{align} [p_1 \quad p_2 \quad p_3] \begin{pmatrix} 1/2 & 1/3 & 1/6\\ 1/4 & 3/4 & 0\\ 1/5 & 2/5 & 2/5 \end{pmatrix} = [p_1 \quad p_2 \quad p_3] \end{align}
using Gauss-Jordan elimination for solving this system it gives me infinite solutions.
I dont know if it is a problem with the transition matrix.
If you want to get a stationary distribution then it's needed to solve the system, consisting of these relations: $$(p_1, p_2, p_3) P = (p_1, p_2, p_3) $$ $$p_1 + p_2 + p_3 =1$$ $$p_i \ge 0, 1 \le i \le 3.$$ If you will get more than one solution it's normal: e.g. if $P$ is identity matrix then every distribution is stationary.
Everything that you did with $D^n$ may be useful for limit distribution but not for stationary one.