Source: https://www.irit.fr/~Julien.Pinquier/Docs/L2_TP2_Probas.pdf