Source: https://perso.univ-rennes1.fr/matthieu.romagny/M2_0607/td1_M2_corrige.pdf