Entropy measures the average surprise of one observation. What does it tell us about a long sequence of observations? Suppose a coin lands heads 90% of the time. The all-heads sequence is the most likely individual outcome, yet a long run usually contains some tails. To understand what we will actually observe, we need to consider whole collections of sequences and their combined probability.

The asymptotic equipartition property (AEP) explains what happens when we draw many independent observations from the same distribution. For a long sequence of observations, the total surprise is usually close to . Equivalently, the probability of the sequence we observe is usually around .

These sequences form the typical set, which contains almost all the probability. Roughly speaking, if each sequence contributes probability , we need about of them for their probabilities to add up to one. To encode a typical sequence, we can send its index in this set. Choosing among about indices takes about bits. The bounds below make these approximations precise.

We will derive the AEP, count typical sequences, and use that count to explain compression and the size of high-probability sets.

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 means and 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.

The name now has a precise meaning: asymptotic refers to long blocks, and equipartition refers to the nearly equal surprise per symbol of blocks that carry most of the probability. It does not make every possible block equally likely.

2. The Typical Set

For , define the 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

The probability bounds specify what this approximation means: the normalized surprise of every typical sequence lies between and .

2.2 How many typical sequences are there?

For sufficiently large , the AEP gives . Combining this with the probability bounds gives

The upper bound holds for every ; the lower bound requires sufficiently large .

The typical set has probability close to one, its sequences have probabilities close to on the exponential scale, and its size is bounded by exponents near . These three properties make it useful for coding.

3. A Biased-Coin Example

Consider a Bernoulli source. Let and write . A particular block containing ones has probability

Its probability depends on the number of ones, not their positions. With high probability, the proportion of ones is close to . The normalized surprise is then close to the binary entropy

and these typical sequences have probabilities near .

Now take . The typical sequences have a proportion of ones close to 0.9. The most likely individual sequence, however, is the all-ones sequence. It falls outside a sufficiently narrow typical band.

This distinction matters: the most likely individual outcome need not belong to the collection of outcomes that carries most of the probability. We will use this distinction to compare typical sets with the smallest high-probability sets.

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.

To encode every possible block, we need to handle both typical and 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 in the atypical set

The decoder reads the flag, then knows how many bits to read. The mapping is one-to-one and reconstructs every block exactly.

Allowing for the flag and rounding, typical codewords have length at most . Atypical codewords have length at most , because there are no more than atypical blocks.

For sufficiently large , . Splitting the expected codeword length between the two sets gives

Thus

First choose small, then choose large. The terms beyond can be made arbitrarily small. Consequently, for any positive rate tolerance, sufficiently long i.i.d. blocks have a one-to-one binary code whose expected bits per symbol are at most entropy plus that tolerance.

The essential idea is that typical sequences receive short descriptions of approximately bits. Atypical sequences may receive longer descriptions, but their small total probability keeps their contribution to the average small.

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. Could a better choice change the exponential size?

Let be a smallest set of blocks satisfying

The lower bound is as follows: for and any , a set with probability greater than satisfies

for sufficiently large . To see why, note that the typical set has probability approaching one. Any set with probability greater than must therefore share substantial probability with it. Each sequence in that intersection has probability at most , so carrying that shared probability requires exponentially many sequences.

The typical set has size between exponents near , and a smallest high-probability set cannot have a substantially smaller exponent. We express this using equality to first order in the exponent:

For a fixed , the smallest-set result is

The two sets can nevertheless differ in membership. For the Bernoulli source with parameter 0.9, a smallest high-probability set is obtained by taking the most probable individual sequences first, including all ones. The typical set instead selects sequences whose proportion of ones is close to 0.9. Their different selection rules still lead to the same leading entropy exponent as the typicality tolerance is made small.

Entropy therefore connects three quantities: the surprise per symbol of a long random block, the exponential size of a high-probability set, and the average number of bits needed to describe a block.

6. Takeaways

  • Average surprise becomes predictable. For i.i.d. symbols, converges in probability to .
  • Typicality concerns total probability. The typical set carries almost all the probability, even though a particular typical sequence can be very unlikely. The most likely individual sequence need not be typical.
  • Entropy controls the number of descriptions. Typical-set size is bounded by exponents near , so a typical block needs about bits to identify.
  • Compression guarantees matter. The flag construction recovers every block exactly and approaches entropy in expected bits per symbol. Problem 5 instead uses fixed-length labels for a selected set and leaves a small probability of unencoded blocks.
  • For products, take logarithms first. Problems 1–4 turn multiplicative quantities into averages, apply the law of large numbers, and transform back when needed.