Source: https://www.iro.umontreal.ca/~lecuyer/ift3655/chaines-Markov.pdf