Source: https://www.lri.fr/~hivert/COURS/Info121/TD3-corr.pdf