FInishing program and Markov chain