Finite Markov Chains and Algorithmic Applications