Source: https://www2.mat.ulaval.ca/fileadmin/Cours/STT-6210/Hiver_14/Exercices/SolutionsChapitre4.pdf