def random_markov_chain(n, k=None, sparse=False, random_state=None):
 P = random_stochastic_matrix(n, k, sparse, format='csr', random_state=random_state)
 mc = MarkovChain(P)
 return mc

def random_markov_chain ( n , k = None , sparse = False , random_state = None ) : P = random_stochastic_matrix ( n , k , sparse , format = 'csr' , random_state = random_state ) mc = MarkovChain ( P ) return mc
return a randomly sampled markovchain instance with n states .