Measures how unevenly something is shared, on a scale from 0 to 1. Everyone equal gives 0, and one person holding everything approaches 1. Widely used for income inequality, it equals the average gap between two randomly chosen people divided by twice the mean.
This puts a number between 0 and 1 on how unevenly something is shared. It is most often used for income inequality.
is the average gap between two randomly chosen people and is the overall mean. If everyone is equal the gaps are 0 and so is ; if one person holds everything it approaches 1.
Sorting the values and weighting each by its position gives the same answer far faster than working through every pair.
Five incomes of 200, 300, 400, 500 and 600 have a mean of 400 and a Gini coefficient of 0.2. The average gap between two people picked at random is . Were all five on 400 it would be 0; were one on 2000 and the rest on nothing, 0.8.
Plotting the cumulative share held by the poorest upwards traces the Lorenz curve, which lies along the diagonal under perfect equality. The Gini coefficient is twice the area between the diagonal and that curve. The more uneven the sharing, the further the curve sags and the larger the area.
The coefficient compresses the whole distribution into one number. The same value can describe concentration at the top or widespread poverty at the bottom, and it cannot tell them apart.
Negative values make it meaningless, so income data including debt needs care.