Function to generate a sequence of states from homogeneous or non-homogeneous Markov chains.
Useful links