Given a transition matrix like the one below I am trying to find out how many states it passes through given that we reach state 4 in the end. State 4 and Out are my two absorption states. Taking the upper left side as matrix Q and finding the inverse of I-Q I know I can calculate the average number of times visiting each state. However I am interested in knowing how many times I would visit each state on average given I get to stage 4. I know I can calculate it using probabilities but I was hoping to use the above method using matrix algebra. Seeing another example suggested removing the OUT column and row and rescaling the probabilities so they still sum to 1 and then applying the same method but I don't seem to be getting the correct answer.Can anyone see where I am likely to be going wrong or explain why the above method wouldn't work?
$$ \begin{matrix} 0 & .3 & .6 & 0 & 0 & .1 \\ 0 & 0 & .5 & .3 & 0 & .2 \\ 0 & 0 & 0 & 0 & .7 & .3 \\ 0 & 0 & 0 & 0 & .2 & .8 \\ 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 \\ \end{matrix} $$
The starting state is always 0. This is what I have done so far. There are three paths we can take that end in state 4 namely 0-1-2-4 , 0-1-3-4, 0-2-4. I am really interested in how many states we pass through before we get to before state 4. Taking the probability of getting to 4 through each route and multiply by the number of states we passed through, I then add together the probabilities of getting to 4 and divide by it. So I get 1.209 / 0.543 = 2.2265…
When calculating it in the matrix form I first remove the OUT column and row leaving the matrix below taking the steps I get the following resulting matrix, adding together the expected number of visits to each state I get an average of 2.3333…
Q = $$ \begin{matrix} 0 & 1/3 & 2/3 & 0 \\ 0 & 0 & 5/8 & 3/8 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ \end{matrix} $$
Inverse (I-Q) = Q = $$ \begin{matrix} 1 & 1/3 & 7/8 & 1/8 \\ 0 & 1 & 5/8 & 3/8 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{matrix} $$
Summing the first row I get 2.333... where have I gone wrong?