Source: http://www.iro.umontreal.ca/~pift3902/Automne 2003/Examens/Final/031203 - Correction.pdf