**Gini coefficient:**

The Gini coefficient is used in economics to measure income inequality. Generally speaking, it is used to measure the extent of departure from a perfectly even distribution of income. A "0" indicates no departure, i.e. everyone has the same income. A "1" indicates complete departure - all income falls into an infinitely small group.

Here´s how it´s calculated. Arrange all the income groups into ascending order of income; for each group find proportion X_{i} of this and lower income groups into the whole population and the corresponding share Y_{i} of income, for example, bottom 0.1 (X_{1}) have 0.01 (Y_{1}) of income, bottom 0.3 (X_{2}) have 0.07 (Y_{2}) of income, etc; then

where (assuming X_{0} = 0). Gini coefficient can be calculated for any number of groups, and the groups may be of different sizes, e.g 4 groups with proportions in the whole population 0.1, 0.3, 0.4, 0.2.