Source: http://www.lamsade.dauphine.fr/~labidi/Cours/DEMI2E1_-_Outils_Informatique/TP2.pdf