markov chain query