Source: https://arnaud.jobin.pro/Informatique/ECE_2/TP/correction_Chaines_Markov.pdf