Source: https://info.uqam.ca/~privat/INF2170/notes_de_cours/ndc03-codage_information.pdf