Source: http://ses-perso.telecom-paristech.fr/bourreau/files/Exercices_Cours03_Correction.pdf