Published
In this lesson
Wide tables, equations, and code scroll sideways. Swipe, or Tab to focus them and use the left and right arrow keys.
Zipf distribution
You will learn: Distinguish finite-rank normalization from an infinite Zipf model and its moment thresholds.
Start with: Pareto distribution
A few ranks can carry much of the probability while a long list carries the rest. But “probability proportional to rank raised to −s” leaves a crucial question unanswered: does the list end? A finite list and an infinite list have different normalizing constants, probabilities, and moments. Review probability mass and cumulative probability and Pareto tails before comparing them.
For an infinite positive-integer rank R, the Zipf or zeta distribution is:
The series converges only for s>1. A list ending at N instead uses the finite sum HN,s=Σⱼ₌₁ᴺ j⁻ˢ. The finite experiment also allows s=0, giving a uniform distribution over its N ranks.
Solid blue: infinite Zipf, when defined. Dashed red: finite ranks 1–30, renormalized over that support. Lines join integer-rank masses as a visual guide; there is no probability assigned to fractional ranks. Both axes show base-10 logarithms. Their slope is −s; an apparent straight line alone is not evidence that observed data follow this law.
| Quantity | Infinite model | Finite model |
|---|---|---|
| Normalizing sum | 1.644934 | 1.612150 |
| P(rank > 10) | 0.05785419 | 0.03869515 |
| Mass beyond displayed ranks | 0.01993025 | 0.000000 |
| Mean rank | Infinite | 2.478049 |
| Variance of rank | Undefined: infinite mean | 12.46796 |
Changing the display window hides ranks but never renormalizes either model. Changing the finite support cutoff defines a different distribution. Infinite-tail calculations use the tail sum directly to retain small probabilities.
Inspect the first ten displayed ranks
| Rank | Infinite mass | Finite mass |
|---|---|---|
| 1 | 0.6079271 | 0.6202896 |
| 2 | 0.1519818 | 0.1550724 |
| 3 | 0.06754746 | 0.06892107 |
| 4 | 0.03799544 | 0.03876810 |
| 5 | 0.02431708 | 0.02481159 |
| 6 | 0.01688686 | 0.01723027 |
| 7 | 0.01240668 | 0.01265897 |
| 8 | 0.009498861 | 0.009692025 |
| 9 | 0.007505273 | 0.007657897 |
| 10 | 0.006079271 | 0.006202896 |
A cutoff changes every retained probability
Take s=2 and just two possible ranks. Their unnormalized weights are 1 and 1/4, with total 5/4. The finite probabilities are therefore 4/5 and 1/5. Their mean is 1·(4/5)+2·(1/5)=1.2, and their variance is (4/5)·0.2²+(1/5)·0.8²=0.16.
For the infinite s=2 model, ζ(2)=π²/6. Its first two masses are about 0.607927 and 0.151982. The remaining 0.240091 lies above rank two. If you condition the infinite model on R≤2, dividing by the retained mass recovers the finite probabilities 0.8 and 0.2.
More generally, the finite model is the infinite model conditioned on its cutoff, when s>1:
The finite model at s≤1 remains well-defined, but there is then no normalized infinite model to condition. The experiment states that distinction instead of inventing an infinite comparison.
Make a prediction
If the plotted window ends at rank 30, must all displayed probabilities add to one?
Explore the answer
No. A display window can omit positive mass. Only a model whose entire support is shown must sum to one in that window. The table reports omitted mass separately; changing the display limit never changes either normalizing constant.
Tail exponents and moment thresholds
The infinite mean is a weighted series:
For 1<s≤2, this nonnegative expectation is infinite. Likewise E[R²] is finite only for s>3, when it equals ζ(s−2)/ζ(s). Subtracting the squared finite mean then gives the variance. The UI distinguishes an infinite variance with a finite mean from an undefined variance when the mean itself is infinite.
Every finite-cutoff model has finite moments, however small s is. Increasing its cutoff may greatly increase its mean or variance even if the first few plotted ranks barely seem to change. At s=0, check the familiar uniform-rank formulas (N+1)/2 and (N²−1)/12 against the table.
The rank mass decays as k⁻ˢ. Summing over larger ranks gives a tail that decays on the order of k⁻⁽ˢ⁻¹⁾. These exponents differ by one; a PMF slope should not be reported as a survival-probability slope. Comparing the sum with the integral of x⁻ˢ explains the tail order.
Read a logarithmic plot as a model statement
Taking logarithms of the PMF gives log₁₀ P(R=k)=−s log₁₀ k−log₁₀ ζ(s). Thus its displayed model points lie on a straight line with slope −s. The red finite model has the same slope but a different vertical offset, and ends at its cutoff.
These are specified probability models, not measured word frequencies or city sizes. Sorting noisy observed counts by size introduces another operation; the resulting rank-frequency plot is not automatically a sample of these fixed rank labels. A straight-looking segment does not establish a power law, its exponent, a causal mechanism, or an appropriate cutoff. Those are questions for a data collection and model-checking analysis.
Make a prediction
Does a finite empirical mean contradict an infinite-mean Zipf model?
Explore the answer
No. A finite sample of finite ranks has a finite arithmetic mean. Infinite expectation is a statement about weighting the entire unbounded population support. It is not a prediction that every finite dataset contains an infinite value.
Compare symmetric stable distributions for another setting where finite-sample summaries can hide nonexistent population moments.
Sources
SciPy’s Zipf reference specifies the infinite model; its Zipfian reference specifies the finite alternative. Clauset, Shalizi, and Newman, “Power-law distributions in empirical data” explains why fitting and checking a power law requires more than a log-log line. The two-rank example and moment-series calculations above can be checked directly.
Return to learning paths and foundations.