http://blog.mathcrowd.cn/understanding_matrix_multiplication_by_markov_chain.html#understanding_matrix_multiplication_by_markov_chain