Source: https://blog.ac-versailles.fr/jpgoualard/public/Exercices_histogrammes.pdf