Source: https://www.ift.ulaval.ca/~agamache/pageperso/LivreBDPDF/Chapitre123.pdf