Do Wikipedia article titles obey Zipf's law?

George Zipf observed that in many forms of written text a few words occur often but most are rare.

Zipf's law states that the frequency of an item is inversely proportional to it's rank in the frequency table. The most frequent word occurs twice as often as the second most frequent word, three times as often as the third most frequent word, and so on.

I was curious how well this law holds up so I decided to examine Wikipedia article titles. Out of 5,674,805 article titles, there were 16,387,602 total word occurences and 1,481,156 unique words. Of those, the top 2,116 words (0.1%) account for half of all word occurences.

While the general idea behind Zipf's law appears to hold true, I found a mean absolute percentange error of 56% between the expected and actual frequency of word occurences.

Below are the top 10 words. The most popular was of, accounting for ~2.5% of all word occurences. The final column shows the percent error between the theoretical frequency, as predicted by Zipf's law, and the actual frequency.

RankWordAbsolute
Frequency
Relative
Frequency
Expected
Relative
Frequency
% Error
1of409,3482.498
2the268,9921.641.25-23.9
3in130,6740.800.834.4
4list103,2880.630.62-0.9
5and85,6830.520.50-4.5
6de56,6170.350.4220.5
7county51,2540.310.3614.1
8film50,2340.310.311.9
9john49,7310.300.28-8.5
10station49,0510.300.25-16.5

You can download the full list of unique words, counts, and relative frequencies here.

Method

You can find my golang source code at github.com/escholtz/wikizipf.