I did the following exercise, but I really don't know if it's okay
A mouse enters a box with 9 gaps as follows:
The probability to go from one state to another is equally probable depending on the space in which it is. Additionally, in space 9 there is a cat that keeps in that space and in space 1 there is cheese.
The question is: What is the probability that the mouse finds the cheese before the mouse eats it?
My attempt:
Construct the matrix of transition probabilities as follows:
\begin{equation*} \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 1/3 & 0 & 1/3 & 0 & 1/3 & 0 & 0 & 0 & 0 \\ 0 & 1/2 & 0 & 0 & 0 & 1/2 & 0 & 0 & 0\\ 1/3 & 0 & 0 & 0 & 1/3 & 0 & 1/3 &0 & 0\\ 0 & 1/4 & 0 & 1/4 & 0 & 1/4 & 0 & 1/4 & 0\\ 0 & 0 & 1/3 & 0 & 1/3 & 0 & 0 & 0 & 1/3\\ 0 & 0 & 0 & 1/2 & 0 & 0 & 0 & 1/2 & 0\\ 0 & 0 & 0 & 0 & 1/3 & 0 & 1/3 &0 & 1/3\\ 0 & 0 & 0 & 0 & 0 & 0 & &0 & 1\\ \end{pmatrix} \end{equation*}
Then I built the canonical matrix by changing columns 1 and 8 and rows 1 and 8. Then calculate the fundamental matrix: $N = (I-Q)^{-1}$, which is:
\begin{equation*} \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1/3 & 0 & 1/3 & 0 & 1/3 & 0 & 0\\ 0 & 1/2 & 0 & 0 & 0 & 1/2 & 0 \\ 1/3 & 0 & 0 & 0 & 1/3 & 0 & 1/3 \\ 0 & 1/4 & 0 & 1/4 & 0 & 1/4 & 0 \\ 0 & 0 & 1/3 & 0 & 1/3 & 0 & 0 \\ 0 & 0 & 0 & 1/2 & 0 & 0 & 0\\ \end{pmatrix} \end{equation*}
And multiplying it by vector 1,
\begin{equation*} \begin{pmatrix} 29/6 \\ 49/10\\ 59/10\\ 137/30\\ 29/5\\ 49/10\\ 57/10\\ \end{pmatrix} \end{equation*}
Therefore, the answer is: The probability that the mouse finds the cheese (it is in cell 1) before it finds the cat (it is in cell 9) is $ 29 / 6$
