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