← LibraryPairwise Independence and Universal Hash FamiliesEngineering · MathematicsLesson 77/385← PrevNext →
ArticlePublished 7 Aug 20263 min readBy Kevin Jogin

Engineering  /  Mathematics  — Discrete Probability

Pairwise Independence and Universal Hash Families

Constructing pairwise independent hash families over finite fields and why the weaker independence suffices.

Page KV-MATH-0348Reading time 3 minReviewed 2026-08-07Author Kevin Jogin

Executive summary

A pairwise independent family makes any two outputs jointly uniform, which is far stronger than universality and still achievable with a constant number of random field elements.

The standard construction is an affine map over a finite field, and its analysis is a two-line argument in linear algebra.

Learning objectives

  1. Construct a pairwise independent family over a finite field.
  2. Prove the pairwise independence property.
  3. Identify the analyses that require only this level.

01The affine construction

Definition

Affine family over a field

Over a finite field F, define h_{a,b}(x) = ax + b for a, b ∈ F chosen uniformly.

Theorem

Pairwise independence

For distinct x ≠ y and any targets s, t, exactly one pair (a, b) satisfies h(x) = s and h(y) = t.

Reason. The two equations form a linear system in (a,b) with matrix determinant x − y ≠ 0, hence a unique solution.

So the pair (h(x), h(y)) is uniform over F × F, which is exactly pairwise independence. Only two field elements of randomness are consumed, independent of the domain size.

02Extending to k-wise independence

Replacing the affine map with a polynomial of degree k − 1 gives k-wise independence, by the same argument via the invertibility of the Vandermonde matrix on distinct points.

h_{a₀,...,a_{k−1}}(x) = a₀ + a₁x + ... + a_{k−1}x^{k−1}
  1. Pairwise2 field elementsSecond-moment arguments, collision bounds
  2. k-wisek field elementsHigher-moment concentration
  3. Fully random|D| log|R| bitsExponential tail bounds; usually unaffordable

03Where it suffices

Any argument resting on expectation or variance needs only pairwise independence, because variance of a sum decomposes under pairwise independence alone.

  • Hash table chain length

    Expected chain length bounds follow from universality; variance bounds from pairwise independence.

  • Collision counting

    The expected number of colliding pairs is a sum of indicator expectations, needing only pairwise behaviour.

  • Leftover hash lemma

    Extracts near-uniform bits from a high-entropy source using only a universal family.

  • Second-moment sampling

    Chebyshev-based estimation of a proportion, with variance from pairwise independence.

What it does not suffice for is amplification by repeated independent trials, where failure probabilities must multiply. That needs mutual independence across the trials, which is supplied by fresh randomness per trial rather than by a hash family.

04Frequently asked questions

Is pairwise independence strictly stronger than universality?

Yes. Pairwise independence implies the universal collision bound, but a universal family need not have uniform individual outputs. Universality constrains collisions only.

Why use a field rather than integers modulo a composite?

Because the construction needs x − y to be invertible for distinct x and y, which requires no zero divisors. Over a composite modulus the argument fails for differences sharing a factor with the modulus.

How much randomness does k-wise independence cost?

k field elements, so roughly k log|D| bits. This grows with k but remains far below the domain size, which is what makes bounded independence useful.

Sources and method

Structural reference: Victor Shoup, A Computational Introduction to Number Theory and Algebra, Version 1, Cambridge University Press, 2005 — book pages 125-127.

This page carries the durable method layer only: definitions, constructions, algorithms, complexity results and selection criteria, authored originally for KEVOS. No text is transcribed or paraphrased from the source, and no numeric tables or benchmark data are reproduced — these are routed to live authoritative sources instead.

Author: Kevin Jogin. Last reviewed 2026-08-07.

Continue learning

Hash Function FamiliesArticle · MathematicsNEXT LESSON →Hash TablesArticle · MathematicsThe Birthday ParadoxArticle · MathematicsMessage Authentication with Hash FunctionsArticle · Mathematics