add probability function to markov.py