1. A method for creating a Markov process that generates sequences, each sequence having a finite length L, comprising items from a set of a specific number n of items, and satisfying one or more control constraints specifying one or more requirements on the sequence, the method comprising the steps of: receiving data defining an initial Markov process of a specific order d and having an initial probability distribution; receiving data defining one or more control constraints; generating data defining intermediary matrices, each matrix being of dimension n d by n, by zeroing out transitions in the initial Markov process data that are forbidden by the one or more control constraints; generating data defining a final non-homogeneous Markov process by processing the intermediary matrices data, generating the sequences having the finite length L by using the final non-homogeneous Markov process data with random walk.