distribution #27
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:

P(R=k)=k−sζ(s),ζ(s)=∑j=1∞j−s,k=1,2,…, s>1.P(R=k)=\frac{k^{-s}}{\zeta(s)},\qquad \zeta(s)=\sum_{j=1}^{\infty}j^{-s},\quad k=1,2,\ldots,\ s>1.

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.

Infinite Zipf and finite-cutoff rank probabilities−3−2.5−2−1.5−1−0.5000.20.40.60.811.21.4log₁₀(rank)log₁₀(probability mass)

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.

QuantityInfinite modelFinite model
Normalizing sum1.6449341.612150
P(rank > 10)0.057854190.03869515
Mass beyond displayed ranks0.019930250.000000
Mean rankInfinite2.478049
Variance of rankUndefined: infinite mean12.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
RankInfinite massFinite mass
10.60792710.6202896
20.15198180.1550724
30.067547460.06892107
40.037995440.03876810
50.024317080.02481159
60.016886860.01723027
70.012406680.01265897
80.0094988610.009692025
90.0075052730.007657897
100.0060792710.006202896
Specified probability models over positive integer ranks, not a fit to word counts or city sizes. Every reported moment and tail uses the full support of its respective model.

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:

PN(R=k)=P(R=k∣R≤N)=k−sHN,s,1≤k≤N.P_N(R=k)=P(R=k\mid R\le N)=\frac{k^{-s}}{H_{N,s}},\quad 1\le k\le N.

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:

E[R]=1ζ(s)∑k=1∞k1−s=ζ(s−1)ζ(s),s>2.E[R]=\frac{1}{\zeta(s)}\sum_{k=1}^{\infty} k^{1-s}=\frac{\zeta(s-1)}{\zeta(s)},\quad s>2.

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.

Reset all settings