I need help identifying what algorithm I need to solve a problem. I'm not asking for programming help here, just identifying the algorithm.
Each row of a matrix represents a state. Each element corresponds to the count of how often the current state transitions to another state. Some states are final states and do not transition at all. Some states are not reachable. There is always at least one path to one of the final states.
I need to calculate the probability of reaching all of the reachable final states and the probability for each final state.
To make this explicit here is an example of what I'm trying to accomplish.
State matrix: $$ \begin{bmatrix} 0& 1& 0& 0& 0& 1 \\ 4& 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& 0 \end{bmatrix} $$
- First state is always 0.
- State 1 is non-terminal.
- State 2 has probability of 0.
- State 3 has probability of 3/14.
- State 4 has probability of 2/14 or 1/7.
- State 5 has probability of 9/14.
If this is a stationary distribution, then that's what I need to code to solve the problem. If not is it something else.