1. The problem statement
Given a stochastic matrix P with states s_1...s_5:
P =
\begin{pmatrix}
1 & p_2 & 0 & 0 & 0\\
0 & 0 & p_3 & 0 & 0\\
0 & q_2 & 0 & p_4 & 0\\
0 & 0 & q_3 & 0 & 0 \\
0 & 0 & 0 & q_4 & 1
\end{pmatrix}
and the matrix A (which is obviously related to P, but I can't see...