Markov chain generator