Given a probability matrix, find probability that person at zero index can go to other rows I was trying to solve a problem in which I was given a matrix containing probabilities of person s[0] to go s[n] as s[0][n]. 
Input:
0   1   0   0   0   1    
4   0   0   3   2   0    
0   0   0   0   0   0    
0   0   0   0   0   0    
0   0   0   0   0   0    
0   0   0   0   0   0

Tracing the probabilities:
[0,1,0,0,0,1]: #s0 the initial state, goes to s1 and s5 with equal probability
[4,0,0,3,2,0]: #s1 can become s0,s3 or s4, but with different probabilities
[0,0,0,0,0,0]: #s2 is terminal, and unreachable
[0,0,0,0,0,0]: #s3 is terminal
[0,0,0,0,0,0]: #s4 is terminal
[0,0,0,0,0,0]: #s5 is terminal 
So we can consider different paths to terminal states such as:
s0->s1->s3
s0->s1->s0->s1->s0->s1->s4
s0->s1->s0->s5
Tracing probabilities of each, we find that:
s2 has probability 0
s3 has probability 3/14
s4 has probability 1/7
s5 has probability 9/14  
Output: [s2.numerator,s3.numerator,s4.numerator,s5.denominator]
which is: [0,3,2,9,14]

I'm trying to apply Regular Markov chain rule but couldn't succeed. Can anyone give me insights about how to solve this problem. Or at least any method or directions which I can use to understand this problem.
Any help would be really appreciated
 A: You’re not going to have much success with regular Markov chain methods unless you start with a proper stochastic transition matrix for this process: the entries are probabilities, which means that their values must lie in the interval $[0,1]$ and each row must sum to $1$. As well, Markov processes never terminate per se. The usual way to model terminal states is with absorbing states, i.e., states that transition only to themselves with probability $1$. The idea here is that once an absorbing state is reached, the process stays in that state from then on.  
Using these criteria, the transition matrix for your process is $$P=\left[\begin{array}{cc|cc}0&\frac12&0&0&0&\frac12 \\ \frac49&0&0&\frac13&\frac29&0 \\ \hline 0&0&1&0&0&0 \\ 0&0&0&1&0&0 \\ 0&0&0&0&1&0 \\ 0&0&0&0&0&1\end{array}\right]=\left[\begin{array}{c|c}Q&R\\\hline0&I\end{array}\right].$$ This matrix is already in canonical form—the states are labeled so that absorbing states come last. The standard techniques of analyzing this matrix subdivide it as shown and then compute the fundamental matrix $N=(I-Q)^{-1}$. The absorption probabilities are then given by $NR$. You can find a derivation of this and other computations that use the fundamental matrix here.  
Since each absorbing state is only reachable from one other state, it’s quite simple and instructive to compute the absorption probabilities directly. I’ll illustrate this by working out the probability that the system ends up in state $S_5$ given that it started in $S_0$. Call this probability $p$, and let $X_k$ be the random variable that represents the system’s state at step $k$. In the first transition, the system either goes to $S_5$ or $S_1$, so $$p=P_{0,5}+qP_{0,1}=\frac12+\frac12q,$$ where $q=\Pr(\text{absorbed by }S_5\mid X_1=1)$ is the probability that the system ends up in $S_5$ if it is in $S_1$ at step 1. Now expand $q$ in a similar way: $$p=\frac12+\frac12(P_{1,5}+rP_{1,0})=\frac12+\frac12\cdot\frac49r,$$ with $r=\Pr(\text{absorbed by }S_5\mid X_2=0)$. Continuing in this fashion, we get a geometric series for $p$, but there’s no reason to go that far. The memoryless property of Markov chains tells us that once the process returns to $S_0$, it effectively restarts, so the probability of being absorbed by $S_5$ when the system is in $S_0$ is the same regardless of which step of the process it is. This means that $$p=\frac12+\frac12\cdot\frac49p,$$ which is easily solved to find that $p=\frac9{14}$. The calculations for the other probabilities proceed along similar lines. In general, you’ll end up with a system of linear equations for the absorption probabilities, which you can then solve using your favorite method.
