Markov chain generation