Entropy measures the average surprise of one observation. What does it tell us about a long sequence of observations? The asymptotic equipartition property (AEP) gives the bridge: for an independent source, the surprise per symbol concentrates near entropy. A relatively small collection of sequences then carries almost all the probability, which makes compression possible.

This note follows Chapter 3 of Cover and Thomas, Elements of Information Theory. It continues Entropy and Mutual Information and Inequalities and Their Consequences. The explanations and worked calculations below are written for these notes.

Assumptions and notation

Let be independent and identically distributed (i.i.d.) with PMF on a finite alphabet . Write for the random block and for a realization. All logarithms are base 2, so entropy and surprise are measured in bits. We restrict attention to symbols with positive probability.


1. From Average Surprise to the AEP

The probability of a particular sequence factors as

Taking a negative logarithm turns this product into a sum:

The expression on the left is random: we first draw a sequence, then evaluate the probability assigned to that sequence. On the right, we average the surprise of its individual symbols.

Define . The are i.i.d., with

The weak law of large numbers therefore gives the asymptotic equipartition property:

Explicitly, for every fixed ,

The proof is short because the main idea is the change of variables: apply the law of large numbers to surprise, rather than to the source symbols themselves. This is Theorem 3.1.1 in the book.

2. The Typical Set

For , define the weakly typical set

Equivalently, a sequence is typical when

The AEP says . It does not say that most sequences are typical when we count every possible sequence equally. Probability mass and the number of sequences are different quantities.

2.1 Why typical sequences are “almost equiprobable”

Every typical sequence has normalized surprise within of . This motivates the shorthand

Here the approximation is on the exponential scale. For fixed , the ratio between the largest and smallest allowed probabilities can be as large as . AEP does not assert that these probability ratios approach one, or that the conditional distribution on the typical set becomes uniform.

2.2 How many typical sequences are there?

Fix an error tolerance . For sufficiently large , AEP gives . Combining this with the probability bounds gives

These are the properties in Theorem 3.1.2, with separate symbols for the surprise tolerance and the missing probability .

There are possible blocks, but approximately relevant ones at exponential resolution. In fact,

For a nonuniform source and , this fraction vanishes even while the typical set’s probability tends to one.

3. A Biased-Coin Example

Let with . A particular block containing ones has probability

and entropy per symbol

Writing , we obtain an exact identity:

Thus, for , weak typicality is equivalent to

For and , this means 87 through 93 ones. Summing the binomial probabilities gives

Even a block of 100 symbols does not make this particular typical set overwhelmingly likely. AEP is a limit theorem; finite-block coverage depends on the source and the tolerance.

3.1 The most likely sequence can be atypical

The most likely individual block is the all-ones sequence. Its normalized surprise is

which remains far from . It is atypical whenever , regardless of .

At , the contrast is:

QuantityValue
Probability of the single all-ones block
Probability of one particular block with 90 ones
Number of blocks with exactly 90 ones
Total probability of all blocks with exactly 90 ones

One all-ones block is much more probable than one block with 90 ones. But the enormous number of blocks with 90 ones makes their combined probability much larger.

The fair-coin boundary case

If , every length- sequence has probability and normalized surprise exactly 1. Every sequence is weakly typical, including all zeros. Weak typicality constrains average surprise; it does not generally require each symbol’s empirical frequency to be close to its true probability. That stronger requirement belongs to frequency-based, or strong, typicality.

4. Why AEP Enables Compression

If both encoder and decoder know , , and , they can agree on an ordering of the typical set. A typical sequence can then be represented by its index, requiring at most

bits. This is the operational meaning of the typical-set size bound.

4.1 Fixed-length coding with a small error probability

Choose a rate and select . For sufficiently large , bits provide enough distinct indices for every typical sequence. Decode those indices correctly and allow an error on atypical inputs. Then

This scheme compresses below the raw alphabet rate while allowing a vanishing probability of reconstruction error. It does not represent every possible block without error.

4.2 Lossless coding with variable length

Section 3.2 of the book gives a construction that also handles atypical sequences. Use a leading flag bit to distinguish two cases:

Input blockEncoding
Typical0 followed by its fixed-width typical-set index
Atypical1 followed by a fixed-width index among all blocks

The decoder reads the flag, then knows how many bits to read. The resulting block code is prefix-free and reconstructs every block exactly.

Let . Allowing for the flag and rounding, typical codewords have length at most ; atypical codewords have length at most . Consequently,

First choose small, then choose large. The expected rate can be made arbitrarily close to from above, as in Theorem 3.2.1.

The construction proves existence. Enumerating an exponentially large typical set is generally impractical; an efficient implementation needs a more structured coding algorithm.

5. Could a Much Smaller Set Carry the Same Probability?

The typical set is one way to capture most of the probability, but it need not be the smallest such set. Section 3.3 asks whether a better choice could change the exponential size.

Fix and let be any set with . Write , which tends to zero. The intersection obeys

Every sequence in that intersection has probability at most , so

for sufficiently large that the prefactor is positive.

Let be the minimum cardinality of a set having probability at least . The intersection bound gives a lower bound, while the typical set supplies an upper bound. Since can be arbitrarily small,

Thus : entropy determines the exponential number of sequences required to capture any fixed probability strictly between zero and one.

For the biased coin, a smallest high-probability set can be formed by taking individual sequences in decreasing probability order, starting with all ones. The typical set instead selects a band of normalized surprise. They can differ in membership and still have the same limiting exponent when the typicality tolerance is taken sufficiently small.

5.1 A compression converse

A fixed-length code with at most messages can correctly reconstruct at most distinct blocks. Call their set . Splitting it into typical and atypical parts gives

If , choose . Both terms tend to zero. The probability of correct reconstruction then vanishes, so the error probability tends to one. This is the fixed-length strong converse for the source considered here, derived from the same typical-set bounds.

6. What the Limit Does—and Does Not—Promise

The order of limits matters. AEP gives high probability for each fixed as grows. It does not guarantee high probability for an arbitrarily fast shrinking . The Chebyshev bound gives one sufficient condition: when is finite.

Similarly, for fixed , the cardinality bounds place the typical set’s normalized log-size between approximately and . To conclude an exact exponent for a sequence of typical sets, the tolerance must shrink in a way that preserves high probability.

Our proof uses independence to factor block probabilities and identical distributions to apply the law of large numbers. Dependent sources require additional assumptions and a more general theorem; the i.i.d. proof cannot simply be reused unchanged.

The useful connection is now concrete: entropy controls the surprise of a long random block, the size of sets that capture its probability, and the number of bits needed to describe it.


Reference

Thomas M. Cover and Joy A. Thomas. Elements of Information Theory, 2nd ed. Wiley, 2006. Chapter 3, “Asymptotic Equipartition Property,” especially Sections 3.1–3.3 and Theorems 3.1.1–3.3.1. Reference consulted: the supplied EPUB, ISBN 9781118585771. The biased-coin discussion develops the chapter’s Bernoulli example; the finite-block values above are calculated directly.