<:> Generating a Markov chain
To generate a variation of the sequence (from which n-gram
probabilities have been sampled) we output n-grams
according to their sampled probabilities.
This is the process of generating a `Markov approximation' or
`Markov chain'.
- Initialise the chain to be any n-gram.
- From all n-grams which extend the chain, make a selection in
accordance with sampled probabilities, and append it to the end of the
chain.
- Repeat previous step until sufficient material has been generated.
The order of the chain is the number of previous elements taken
into account in generating each new element.