Source: https://www.stats.ox.ac.uk/~teh/teaching/dtc2014/Markov.pdf