Source: https://www.math.univ-toulouse.fr/~pmaillar/cours/modelisation2020/TP1_2020_corrige.pdf