Typical Sequence Visualizer

ECE 420 · Wireless Communications · NC State University

Background: The Asymptotic Equipartition Property (AEP) is a cornerstone of information theory. For a sequence of n i.i.d. (independent, identically distributed) random symbols, as n grows large, almost all of the probability mass concentrates on a shrinking fraction of "typical" sequences — those whose empirical rate of surprise, −(1/n)log₂P(xn), lands close to the true source entropy H(X) (the entropy of random variable X, in bits — a measure of the average information content, or "surprise," per symbol). Non-typical sequences may still exist, but collectively they carry almost no probability. This concentration phenomenon is exactly what makes both source coding (compression) and channel coding (error correction) theorems work.

Description of This Web Application: This app lets you tune the sequence length n, the bit probability p (of a Bernoulli(p) source, i.e. a biased coin), and the tolerance ε, and immediately see which outcomes are ε-typical (members of the typical set Aε(n)). It shows the binomial distribution with typical sequences highlighted, a sequence-space map comparing the typical set to the full space, a bar chart of set size versus probability mass, and a convergence plot showing what happens as n grows toward 100 and beyond.

For example, with n = 100 bits and p = 0.1, there are 2100 possible sequences in total — but only the ε-typical ones, roughly 2n·H(X) ≈ 247 of them (since H(0.1) ≈ 0.469 bits/symbol), carry essentially all of the probability. Every other sequence, though technically possible, occurs with astronomically small probability. By the end, you should be able to explain why the typical set is exponentially smaller than the full sequence space yet still carries nearly all the probability, and how ε and n trade off in the AEP bounds.

Configuration

Legend

ε-typical sequences (in Aε(n))
Non-typical sequences
Total probability mass
Fraction of sequence space
A sequence xn is ε-typical if its empirical rate of surprise is within ε of H(X). Hover any bar for details.
Sequence Space Map 2n total sequences
Set Size vs. Probability Mass a small set can carry most of the probability
Binomial Distribution — Typical vs. Non-Typical blue = ε-typical: |−(1/n)log₂ P(xn) − H(X)| ≤ ε
AEP Convergence as n → ∞ prob. mass → 1, while % of sequences → 0
AEP Key Results