Algorithms on Markov Chains.