Source: https://www-igm.univ-mlv.fr/~cdavid/fr/cours/2012-archiL3/2012-L3-exam.pdf