Zipf's law

From testwiki
Revision as of 01:15, 12 February 2025 by imported>Natg 19 (Disambiguate Tibetan language to Lhasa Tibetan using popups)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description Template:For Template:Use dmy dates

Zipf's Law on War and Peace.[1] The lower plot shows the remainder when the Zipf law is divided away. It shows that there remains significant pattern not fitted by Zipf law.
A plot of the frequency of each word as a function of its frequency rank for two English language texts: Culpeper's Complete Herbal (1652) and H. G. Wells's The War of the Worlds (1898) in a log-log scale. The dotted line is the ideal law y1x.

Zipf's law (Template:IPAc-en; Template:IPA) is an empirical law stating that when a list of measured values is sorted in decreasing order, the value of the Template:Mvar-th entry is often approximately inversely proportional to Template:Mvar.

The best known instance of Zipf's law applies to the frequency table of words in a text or corpus of natural language:

 𝗐𝗈𝗋𝖽 𝖿𝗋𝖾𝗊𝗎𝖾𝗇𝖼𝗒  1 𝗐𝗈𝗋𝖽 𝗋𝖺𝗇𝗄 .

It is usually found that the most common word occurs approximately twice as often as the next common one, three times as often as the third most common, and so on. For example, in the Brown Corpus of American English text, the word "the" is the most frequently occurring word, and by itself accounts for nearly 7% of all word occurrences (69,971 out of slightly over 1 million). True to Zipf's law, the second-place word "of" accounts for slightly over 3.5% of words (36,411 occurrences), followed by "and" (28,852).[2] It is often used in the following form, called Zipf-Mandelbrot law:

 𝖿𝗋𝖾𝗊𝗎𝖾𝗇𝖼𝗒  1 ( 𝗋𝖺𝗇𝗄+b )a   where  a  and  b  are fitted parameters, with  a1, and  b2.7.[1]

This law is named after the American linguist George Kingsley Zipf,[3][4][5] and is still an important concept in quantitative linguistics. It has been found to apply to many other types of data studied in the physical and social sciences.

In mathematical statistics, the concept has been formalized as the Zipfian distribution: A family of related discrete probability distributions whose rank-frequency distribution is an inverse power law relation. They are related to Benford's law and the Pareto distribution.

Some sets of time-dependent empirical data deviate somewhat from Zipf's law. Such empirical distributions are said to be quasi-Zipfian.

History

In 1913, the German physicist Felix Auerbach observed an inverse proportionality between the population sizes of cities, and their ranks when sorted by decreasing order of that variable.[6]

Zipf's law had been discovered before Zipf,Template:Efn first by the French stenographer Jean-Baptiste Estoup in 1916,Template:Refn[7] and also by G. Dewey in 1923,[8] and by E. Condon in 1928.[9]

The same relation for frequencies of words in natural language texts was observed by George Zipf in 1932,[4] but he never claimed to have originated it. In fact, Zipf did not like mathematics. In his 1932 publication,[10] the author speaks with disdain about mathematical involvement in linguistics, a.o. ibidem, p. 21:

... let me say here for the sake of any mathematician who may plan to formulate the ensuing data more exactly, the ability of the highly intense positive to become the highly intense negative, in my opinion, introduces the devil into the formula in the form of  i.

The only mathematical expression Zipf used looks like Template:Nobr which he "borrowed" from Alfred J. Lotka's 1926 publication.[11]

The same relationship was found to occur in many other contexts, and for other variables besides frequency.[1] For example, when corporations are ranked by decreasing size, their sizes are found to be inversely proportional to the rank.[12] The same relation is found for personal incomes (where it is called Pareto principle[13]), number of people watching the same TV channel,[14] notes in music,[15] cells transcriptomes,[16][17] and more.

In 1992 bioinformatician Wentian Li published a short paper[18] showing that Zipf's law emerges even in randomly generated texts. It included proof that the power law form of Zipf's law was a byproduct of ordering words by rank.

Formal definition

Template:Probability distribution

Formally, the Zipf distribution on Template:Mvar elements assigns to the element of rank Template:Mvar (counting from 1) the probability:

 f(k;N)={1 HN 1 k  ,  if  1kN,0,  if  k<1  or  N<k. where Template:MvarTemplate:Mvar is a normalization constant: The Template:Mvarth harmonic number:

HNk=1N 1 k.

The distribution is sometimes generalized to an inverse power law with exponent Template:Mvar instead of Template:Math[19] Namely,

f(k;N,s)=1HN,s1ks

where Template:MvarTemplate:Mvar,Template:Mvar is a generalized harmonic number

HN,s=k=1N1ks.

The generalized Zipf distribution can be extended to infinitely many items (Template:Mvar = ∞) only if the exponent Template:Mvar exceeds Template:Math In that case, the normalization constant Template:MvarTemplate:Mvar,Template:Mvar becomes Riemann's zeta function,

ζ(s)=k=11ks<.

The infinite item case is characterized by the Zeta distribution and is called Lotka's law. If the exponent Template:Mvar is Template:Math or less, the normalization constant Template:MvarTemplate:Mvar,Template:Mvar diverges as Template:Mvar tends to infinity.

Empirical testing

Empirically, a data set can be tested to see whether Zipf's law applies by checking the goodness of fit of an empirical distribution to the hypothesized power law distribution with a Kolmogorov–Smirnov test, and then comparing the (log) likelihood ratio of the power law distribution to alternative distributions like an exponential distribution or lognormal distribution.[20]

Zipf's law can be visuallized by plotting the item frequency data on a log-log graph, with the axes being the logarithm of rank order, and logarithm of frequency. The data conform to Zipf's law with exponent Template:Mvar to the extent that the plot approximates a linear (more precisely, affine) function with slope Template:Mvar. For exponent Template:Nobr one can also plot the reciprocal of the frequency (mean interword interval) against rank, or the reciprocal of rank against frequency, and compare the result with the line through the origin with slope Template:Math[3]

Statistical explanations

Although Zipf's Law holds for most natural languages, and even certain artificial ones such as Esperanto[21] and Toki Pona,[22] the reason is still not well understood.[23] Recent reviews of generative processes for Zipf's law include Mitzenmacher, "A Brief History of Generative Models for Power Law and Lognormal Distributions",[24] and Simkin, "Re-inventing Willis".[25]

However, it may be partly explained by statistical analysis of randomly generated texts. Wentian Li has shown that in a document in which each character has been chosen randomly from a uniform distribution of all letters (plus a space character), the "words" with different lengths follow the macro-trend of Zipf's law (the more probable words are the shortest and have equal probability).[18] In 1959, Vitold Belevitch observed that if any of a large class of well-behaved statistical distributions (not only the normal distribution) is expressed in terms of rank and expanded into a Taylor series, the first-order truncation of the series results in Zipf's law. Further, a second-order truncation of the Taylor series resulted in Mandelbrot's law.[26][27]

The principle of least effort is another possible explanation: Zipf himself proposed that neither speakers nor hearers using a given language wants to work any harder than necessary to reach understanding, and the process that results in approximately equal distribution of effort leads to the observed Zipf distribution.[5][28]

A minimal explanation assumes that words are generated by monkeys typing randomly. If language is generated by a single monkey typing randomly, with fixed and nonzero probability of hitting each letter key or white space, then the words (letter strings separated by white spaces) produced by the monkey follows Zipf's law.[29]

Another possible cause for the Zipf distribution is a preferential attachment process, in which the value Template:Mvar of an item tends to grow at a rate proportional to Template:Mvar (intuitively, "the rich get richer" or "success breeds success"). Such a growth process results in the Yule–Simon distribution, which has been shown to fit word frequency versus rank in language[30] and population versus city rank[31] better than Zipf's law. It was originally derived to explain population versus rank in species by Yule, and applied to cities by Simon.

A similar explanation is based on atlas models, systems of exchangeable positive-valued diffusion processes with drift and variance parameters that depend only on the rank of the process. It has been shown mathematically that Zipf's law holds for Atlas models that satisfy certain natural regularity conditions.[32][33]

A generalization of Zipf's law is the Zipf–Mandelbrot law, proposed by Benoit Mandelbrot, whose frequencies are:

f(k;N,q,s)=1 C  1 (k+q)s.Template:Clarify

The constant Template:Mvar is the Hurwitz zeta function evaluated at Template:Mvar.

Zipfian distributions can be obtained from Pareto distributions by an exchange of variables.[19]

The Zipf distribution is sometimes called the discrete Pareto distribution[34] because it is analogous to the continuous Pareto distribution in the same way that the discrete uniform distribution is analogous to the continuous uniform distribution.

The tail frequencies of the Yule–Simon distribution are approximately

f(k;ρ) [𝖼𝗈𝗇𝗌𝗍𝖺𝗇𝗍] k(ρ+1) for any choice of Template:Nobr

In the parabolic fractal distribution, the logarithm of the frequency is a quadratic polynomial of the logarithm of the rank. This can markedly improve the fit over a simple power-law relationship.[35] Like fractal dimension, it is possible to calculate Zipf dimension, which is a useful parameter in the analysis of texts.[36]

It has been argued that Benford's law is a special bounded case of Zipf's law,[35] with the connection between these two laws being explained by their both originating from scale invariant functional relations from statistical physics and critical phenomena.[37] The ratios of probabilities in Benford's law are not constant. The leading digits of data satisfying Zipf's law with Template:Nobr satisfy Benford's law.

n Benford's law: P(n)=
log10(n+1)log10(n)
log(P(n)/P(n1))log(n/(n1))
1 0.30103000
2 0.17609126 −0.7735840
3 0.12493874 −0.8463832
4 0.09691001 −0.8830605
5 0.07918125 −0.9054412
6 0.06694679 −0.9205788
7 0.05799195 −0.9315169
8 0.05115252 −0.9397966
9 0.04575749 −0.9462848

Occurrences

City sizes

Following Auerbach's 1913 observation, there has been substantial examination of Zipf's law for city sizes.[38] However, more recent empirical[39][40] and theoretical[41] studies have challenged the relevance of Zipf's law for cities.

Word frequencies in natural languages

Zipf's law plot for the first 10 million words in 30 Wikipedias (as of October 2015) in a log-log scale

In many texts in human languages, word frequencies approximately follow a Zipf distribution with exponent Template:Mvar close to 1; that is, the most common word occurs about Template:Mvar times the Template:Mvar-th most common one.

The actual rank-frequency plot of a natural language text deviates in some extent from the ideal Zipf distribution, especially at the two ends of the range. The deviations may depend on the language, on the topic of the text, on the author, on whether the text was translated from another language, and on the spelling rules used.Template:Citation needed Some deviation is inevitable because of sampling error.

At the low-frequency end, where the rank approaches Template:Mvar, the plot takes a staircase shape, because each word can occur only an integer number of times. Template:Clear

A log-log plot of word frequency in the English Wikipedia (27 November 2006). Zipf's law corresponds to the middle linear portion of the curve, roughly following the green Template:Nobr while the early part is closer to the magenta Template:Nobr while the later part is closer to the cyan Template:Nobr Other descriptions highlight two segments or "regimes" instead.[42][43]

In some Romance languages, the frequencies of the dozen or so most frequent words deviate significantly from the ideal Zipf distribution, because of those words include articles inflected for grammatical gender and number.Template:Citation needed

In many East Asian languages, such as Chinese, Tibetan, and Vietnamese, each morpheme (word or word piece) consists of a single syllable; a word of English being often translated to a compound of two such syllables. The rank-frequency table for those morphemes deviates significantly from the ideal Zipf law, at both ends of the range.Template:Citation needed

Even in English, the deviations from the ideal Zipf's law become more apparent as one examines large collections of texts. Analysis of a corpus of 30,000 English texts showed that only about 15% of the texts in it have a good fit to Zipf's law. Slight changes in the definition of Zipf's law can increase this percentage up to close to 50%.[44]

In these cases, the observed frequency-rank relation can be modeled more accurately as by separate Zipf–Mandelbrot laws distributions for different subsets or subtypes of words. This is the case for the frequency-rank plot of the first 10 million words of the English Wikipedia. In particular, the frequencies of the closed class of function words in English is better described with Template:Mvar lower than 1, while open-ended vocabulary growth with document size and corpus size require Template:Mvar greater than 1 for convergence of the Generalized Harmonic Series.[3]

Well's War of the Worlds in plain text, in a book code, and in a Vigenère cipher

When a text is encrypted in such a way that every occurrence of each distinct plaintext word is always mapped to the same encrypted word (as in the case of simple substitution ciphers, like the Caesar ciphers, or simple codebook ciphers), the frequency-rank distribution is not affected. On the other hand, if separate occurrences of the same word may be mapped to two or more different words (as happens with the Vigenère cipher), the Zipf distribution will typically have a flat part at the high-frequency end.Template:Citation needed

Applications

Zipf's law has been used for extraction of parallel fragments of texts out of comparable corpora.[45] Laurance Doyle and others have suggested the application of Zipf's law for detection of alien language in the search for extraterrestrial intelligence.[46][47]

The frequency-rank word distribution is often characteristic of the author and changes little over time. This feature has been used in the analysis of texts for authorship attribution.[48][49]

The word-like sign groups of the 15th-century codex Voynich Manuscript have been found to satisfy Zipf's law, suggesting that text is most likely not a hoax but rather written in an obscure language or cipher.[50][51]

See also

Notes

Template:Notelist

References

Template:Reflist

Further reading

Template:Library resources box Template:Commons category

Template:ProbDistributions Template:Authority control

  1. 1.0 1.1 1.2 Cite error: Invalid <ref> tag; no text was provided for refs named piant2014
  2. Cite error: Invalid <ref> tag; no text was provided for refs named fagan2010
  3. 3.0 3.1 3.2 Cite error: Invalid <ref> tag; no text was provided for refs named Powers1998
  4. 4.0 4.1 Cite error: Invalid <ref> tag; no text was provided for refs named zipf1935
  5. 5.0 5.1 Cite error: Invalid <ref> tag; no text was provided for refs named zipf1949
  6. Cite error: Invalid <ref> tag; no text was provided for refs named Auerbach1913
  7. Cite error: Invalid <ref> tag; no text was provided for refs named mann1999
  8. Template:Cite book
  9. Template:Cite journal
  10. Cite error: Invalid <ref> tag; no text was provided for refs named zipf1932
  11. Cite error: Invalid <ref> tag; no text was provided for refs named king1942
  12. Cite error: Invalid <ref> tag; no text was provided for refs named axte2001
  13. Template:Cite book
  14. Cite error: Invalid <ref> tag; no text was provided for refs named erik2014
  15. Cite error: Invalid <ref> tag; no text was provided for refs named zann2004
  16. Cite error: Invalid <ref> tag; no text was provided for refs named lazz2023
  17. Cite error: Invalid <ref> tag; no text was provided for refs named chen2011
  18. 18.0 18.1 Cite error: Invalid <ref> tag; no text was provided for refs named liwe1992
  19. 19.0 19.1 Cite error: Invalid <ref> tag; no text was provided for refs named adam2000
  20. Template:Cite journal
  21. Cite error: Invalid <ref> tag; no text was provided for refs named mana2006
  22. Cite error: Invalid <ref> tag; no text was provided for refs named skot2020
  23. Cite error: Invalid <ref> tag; no text was provided for refs named bril1959
  24. Template:Cite journal
  25. Template:Cite journal
  26. Cite error: Invalid <ref> tag; no text was provided for refs named bele1959
  27. Cite error: Invalid <ref> tag; no text was provided for refs named neum2011
  28. Cite error: Invalid <ref> tag; no text was provided for refs named ferr2003
  29. Template:Cite journal
  30. Cite error: Invalid <ref> tag; no text was provided for refs named linr2014
  31. Cite error: Invalid <ref> tag; no text was provided for refs named vita2015
  32. Cite error: Invalid <ref> tag; no text was provided for refs named fern2020
  33. Cite error: Invalid <ref> tag; no text was provided for refs named taot2012
  34. Cite error: Invalid <ref> tag; no text was provided for refs named john1992
  35. 35.0 35.1 Cite error: Invalid <ref> tag; no text was provided for refs named Galien
  36. Cite error: Invalid <ref> tag; no text was provided for refs named efte2006
  37. Cite error: Invalid <ref> tag; no text was provided for refs named piet2001
  38. Cite error: Invalid <ref> tag; no text was provided for refs named gaba1999
  39. Cite error: Invalid <ref> tag; no text was provided for refs named arsh2018
  40. Cite error: Invalid <ref> tag; no text was provided for refs named ganl2006
  41. Cite error: Invalid <ref> tag; no text was provided for refs named verb2020
  42. Cite error: Invalid <ref> tag; no text was provided for refs named cancho2001
  43. Cite error: Invalid <ref> tag; no text was provided for refs named dm2002
  44. Cite error: Invalid <ref> tag; no text was provided for refs named more2016
  45. Cite error: Invalid <ref> tag; no text was provided for refs named moha2016
  46. Template:Cite journal
  47. Template:Cite book
  48. Cite error: Invalid <ref> tag; no text was provided for refs named droo2016
  49. Cite error: Invalid <ref> tag; no text was provided for refs named droo2019
  50. Cite error: Invalid <ref> tag; no text was provided for refs named boyle2022
  51. Cite error: Invalid <ref> tag; no text was provided for refs named mont2013