Absorbing Markov chain function
P = [[Q,R],[0,I]]
A state k is absorbing when p_kk = 1 and p_kj = 0 for every other state j, so no one who enters it can leave. Ordering the transient states first writes the transition matrix in canonical form, with Q the transitions among transient states, R the transitions from transient to absorbing states, a zero block and an identity block for the absorbing states. From Q and R the expected time before absorption and the probability of ending in each absorbing state follow without running the cohort trace s_(t+1) = s_t P.
Expected cycles before absorption from the fundamental matrix
t_abs = (I - Q)^(-1) * c
Probability of ending in each absorbing state
B = (I - Q)^(-1) * R