Source: https://www.iro.umontreal.ca/~mignotte/IFT6150/Chapitre1_IFT6150.pdf