Markov chain simulator