Study Vault Search notes, aliases and full text
Graph
ConceptDBISAI-written · not yet proofread

Zipf's Law

Also Zipf

Zipf's law is the empirical observation that the frequency F_n of the n-th most frequent word of a text collection follows a power law F_n = C · n^(−α), i.e. a falling straight line in a log-log plot.

Formula#

Taking logarithms on both sides:

Fn=C⋅n−α  ⟺  log⁡Fn=−α⋅log⁡n+log⁡C.F_n = C \cdot n^{-\alpha} \iff \log F_n = -\alpha \cdot \log n + \log C.
ProofStraight line in the log-log plot (exam WS 21/22, Task 2.1)

In the plain plot, x=nx = n and y=Fn=C/xαy = F_n = C / x^\alpha. Then log⁡y=log⁡(C/xα)=−αlog⁡x+log⁡C\log y = \log(C / x^\alpha) = -\alpha \log x + \log C. With X=log⁡xX = \log x on the x-axis and Y=log⁡yY = \log y on the y-axis this is Y=−αX+log⁡CY = -\alpha X + \log C: a straight line with slope −α<0-\alpha < 0 and intercept log⁡C\log C. ■\blacksquare

Fitting CC and α\alpha when the law holds exactly (frequencies sorted descending, F1≥F2≥…F_1 \ge F_2 \ge \dots):

  1. F1=C⋅1−α=CF_1 = C \cdot 1^{-\alpha} = C, so C=F1C = F_1.
  2. F2=C⋅2−αF_2 = C \cdot 2^{-\alpha}, so α=−log⁡2(F2/C)=log⁡2(F1/F2)\alpha = -\log_2 (F_2 / C) = \log_2 (F_1 / F_2).
  3. Check Fn=C⋅n−αF_n = C \cdot n^{-\alpha} for n≥3n \ge 3.

Properties#

  • In the plain plot (nn against FnF_n) the curve looks like a hyperbola: there are only a few very frequent words, and most words are rare (long tail).
  • Frequency here is the collection frequency (sum of the term frequencies over all documents), not the document frequency df\mathrm{df}.
  • One way to estimate the number of web pages is based on Zipf’s law (DBIS_VL01 > Keyword Search: Problem and Naive Solution).

Example#

Sources#

  • Slides 01, p. 22
  • DBIS_VL01 > Zipf’s Law
  • Exams: DBIS Exam WS1920 (not published) Task 1.1, DBIS Exam WS2122 (not published) Task 2.1, DBIS Exam WS2324 (not published) Task 1.1, DBIS Exam WS2324-2 (not published) Task 1.3 (1)

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only