I have a Markov chain with the transition matrix
$$\pmatrix{0 & 0.7 & 0.3 \\ 0.8 & 0 & 0.2 \\ 0.6 & 0.4 & 0}$$
and I would like to generate a random sequence between the three states (such as $1, 2, 1, 3, \dots, n$). How do I get there while making sure the transition probabilities roughly apply for my sample?