Source: https://fac.umc.edu.dz/ista/pdf/cours/L2-PMI_AUTO 3 TD 3 Solution1.pdf