Information Theory and Entropy

Information theory quantifies information, uncertainty, and the limits of communication. Its central quantity, Shannon entropy , measures the average uncertainty (in bits) of a random variable. It governs data compression (source coding) and reliable transmission (channel coding). Founded by Claude Shannon in his 1948 paper A Mathematical Theory of Communication.

Information theory is the mathematical study of the storage, transmission, and quantification of information. At its heart lies entropy, a number measuring the average unpredictability of a random source: a fair coin carries 1 bit per toss, while a biased coin carries less. Entropy sets a hard floor on how much data can be compressed without loss and—via channel capacity—a hard ceiling on how fast information can flow through a noisy medium. The surprising fact is that these two seemingly different limits emerge from a single coherent framework, and that reliable communication over noise is possible at all below capacity, with error probability driven arbitrarily close to zero. This unification, achieved in one 1948 paper, underpins every modern digital technology.

The Core Insight

Information is the resolution of uncertainty. The amount of information in an event is inversely related to its probability: rare events are surprising and informative; certain events tell us nothing. Entropy is the expected surprise. Once you measure uncertainty in bits, the entire theory of compression and communication follows as a matter of counting.

Formal Statement

Self-Information (Surprisal)

The self-information of an event with probability is

1
⟳Demand that information be (i) decreasing in probability, (ii) additive for independent events , and (iii) continuous. Cauchy's functional equation forces a logarithm.

The base fixes the unit: gives bits, gives nats, gives dits/hartleys. Symbol is the probability mass of outcome .

Shannon Entropy

For a discrete random variable with alphabet and pmf , the entropy is the expected self-information:

2
⟳Take the expectation of equation [1] under . The convention is used, justified by .

Here is measured in bits, is the (finite or countable) set of outcomes, and the sum runs over all with .

Joint, Conditional Entropy, and Mutual Information

For two random variables :

3
⟳Apply equation [2] to the joint pmf over the product alphabet .

4
⟳Average the entropy of given over : . The chain-rule form follows from and splitting the log.
5
⟳Mutual information is the KL divergence between the joint and the product of marginals; expand the log of the ratio and regroup using [2] and [4].

Kullback–Leibler Divergence

The relative entropy between distributions and on the same alphabet is

6
⟳Measure the expected number of extra bits paid for coding samples from using a code optimal for ; this is .

is not symmetric and is not a metric, but with equality iff .

Shannon's Source Coding Theorem

Let be i.i.d. samples from . For any , there exists a lossless code with expected length per symbol satisfying for large enough, and no lossless code can achieve . Entropy is the fundamental limit of lossless compression.

Noisy-Channel Coding Theorem

For a discrete memoryless channel with transition law , define capacity

7
⟳Capacity is the largest mutual information achievable by optimizing the input distribution; the max exists because is continuous and concave in over a compact simplex.

For any rate , there exist codes of block length with error probability as . For , error probability is bounded away from zero.

Why It Holds / Derivation

Entropy Bounds and Non-negativity of KL

We establish and .

  1. Non-negativity of . Each term since makes . Hence , with equality iff some (a deterministic variable).
  1. Gibbs' inequality (KL ). Use for . Then
8
⟳Apply with , multiply by , and sum; both distributions normalize to 1.
  1. Therefore , with equality iff everywhere, i.e. .
  1. Maximum entropy. Set to the uniform distribution . Then
9
⟳Substitute into [6], split the logarithm, and recognize . Non-negativity from step 2 gives the bound.
  1. Hence , with equality iff is uniform. Uncertainty is maximized when all outcomes are equally likely.

Claude Shannon | 1916–2001

An American mathematician and electrical engineer at Bell Labs, Shannon single-handedly founded information theory with his 1948 monograph. His earlier 1937 master's thesis showed that Boolean algebra could describe switching circuits—arguably the most influential master's thesis ever, birthing digital logic design. Shannon was famously playful: he built juggling machines, a mechanical mouse that solved mazes ("Theseus"), and rode a unicycle through Bell Labs corridors. He chose the word "entropy" on the advice of John von Neumann, who reportedly told him no one understands entropy, so he'd always win an argument.

Building Intuition

Think of entropy as the average number of yes/no questions needed to pin down an outcome using an optimal questioning strategy. If a horse race has 8 equally likely horses, you need 3 questions ("Is it in the top half?" etc.)—and bits. If one horse is a near-certain favorite, you often guess right with one question, so the average drops below 3.

The biased coin is the cleanest mental model. A fair coin gives 1 bit. A coin that lands heads 90% of the time is mostly predictable: most flips tell you little, so its entropy is only about 0.47 bits. A two-headed coin gives 0 bits—you learn nothing.

Mutual information is the overlap of uncertainties: how much knowing shaves off your uncertainty about . It is symmetric—learning about smoke tells you exactly as much about fire as vice versa.

Binary entropy function $H(p) = -p\log_2 p - (1-p)\log_2(1-p)$, peaking at $p=0.5$

probability p H(p) bits 0 0.5 1 1 max = 1 bit

Worked Examples

Entropy of a Biased Coin

Given: A coin lands heads with probability , tails with . Steps:
  1. Apply equation [2]: .
  2. bits.
  3. bits.
  4. Sum: bits.

Interpretation: a long sequence of such flips can be compressed to roughly bits, versus bits for naive storage—an 19% saving.

Capacity of a Binary Symmetric Channel

Given: A binary symmetric channel (BSC) flips each transmitted bit independently with probability . Steps:
  1. Capacity of a BSC: bits per channel use, where is the binary entropy of the flip probability.
  2. Compute .
  3. bits.
  4. bits.
  5. bits, so .

Interpretation: despite 10% noise, you can transmit reliably (with vanishing error) at up to about 0.53 information bits per physical bit sent, using a good error-correcting code.

Common Misconceptions

Entropy is not disorder, and high entropy is not "bad." In information theory, entropy measures uncertainty about which message will occur, not physical messiness. A maximally compressed file looks like random noise precisely because it has maximal entropy—every bit is informative. Information is not the same as meaning. Shannon's theory is deliberately semantic-free: the string "asdfjkl" and a Shakespeare sonnet of equal length and letter statistics carry the same Shannon information. Meaning lives outside the theory. Bits-the-unit vs. bits-the-storage. A source with entropy 0.8 bits/symbol still requires whole physical bits to store one symbol; the entropy is the amortized limit over long sequences, not a per-symbol storage size. "More outcomes always means more entropy." False. Consider over 1000 outcomes where one outcome has probability and the remaining 999 share . Its entropy is about bits—far less than a fair coin's 1 bit over only 2 outcomes. Entropy depends on the shape of the distribution, not the alphabet size alone. Only the uniform distribution attains the maximum .

Connections

Information theory sits at a crossroads. Its entropy formula is mathematically identical (up to Boltzmann's constant) to the Statistical Mechanics entropy , linking information to thermodynamics via Maxwell's Demon and Landauer's principle. The KL divergence is the workhorse of Bayesian Inference and underlies Maximum Likelihood Estimation, since maximizing likelihood minimizes . Mutual information is a central objective in Machine Learning, from feature selection to the information bottleneck. The maximum-entropy principle connects to Probability Theory as a least-biased way to assign distributions under constraints, recovering the Gaussian and exponential families.

Real-World Applications

  1. Data compression. ZIP, gzip, and PNG use entropy coders (Huffman, arithmetic coding) approaching the entropy limit; JPEG and MP3 combine this with lossy quantization guided by rate-distortion theory.
  2. Error-correcting codes. Reed–Solomon codes on CDs/DVDs/QR codes, LDPC codes in Wi-Fi (802.11n) and 5G, and Turbo codes in deep-space probes all operate near Shannon capacity.
  3. Cryptography. Shannon's notion of perfect secrecy (the one-time pad) and entropy as a measure of key unpredictability/randomness underpin secure key generation.
  4. Machine learning. Cross-entropy loss trains nearly every neural network classifier; decision trees split on information gain (mutual information).
  5. Genomics & neuroscience. Mutual information quantifies neural coding efficiency and identifies co-evolving residues or regulatory motifs in DNA sequences.
  6. Communication systems. The Shannon–Hartley theorem dictates modem, DSL, fiber, and cellular data-rate design.
  7. Quantum information. Von Neumann entropy generalizes Shannon entropy to density matrices, grounding quantum computing and entanglement measures.

Historical Development

  • 1924–1928: Harry Nyquist and Ralph Hartley at Bell Labs quantify "information" via of the number of possible messages, anticipating the logarithmic measure.
  • 1940–1945: Shannon works on cryptography and fire-control during WWII; his classified report A Mathematical Theory of Cryptography (1945) contains early entropy ideas.
  • 1948: Shannon publishes A Mathematical Theory of Communication in the Bell System Technical Journal, defining entropy, channel capacity, and the coding theorems.
  • 1949: The paper is republished as a book with Warren Weaver's accessible introduction; Shannon also proves the sampling theorem's role and analyzes the one-time pad.
  • 1951: Shannon estimates the entropy of printed English at roughly 1 bit per letter using human prediction experiments.
  • 1951: Solomon Kullback and Richard Leibler introduce relative entropy (KL divergence).
  • 1957: Edwin Jaynes formulates the maximum entropy principle, recasting statistical mechanics as inference.
  • 1961: Rolf Landauer establishes that erasing one bit dissipates at least of heat, physically grounding information.
  • 1993–2008: Practical capacity-approaching codes arrive—Turbo codes (Berrou et al., 1993) and the rediscovery of LDPC codes (Gallager 1962; MacKay 1996)—finally realizing Shannon's 1948 promise.

Subtleties & Limits

Several deep issues remain active. Differential entropy for continuous variables can be negative and is not coordinate-invariant, requiring care; the right invariant object is relative entropy or mutual information. Finite-blocklength information theory (Polyanskiy–Poor–Verdú, 2010) sharpens Shannon's asymptotic limits for the short codes used in real low-latency systems—an ongoing refinement. The information bottleneck as a theory of deep learning generalization is debated. In the quantum realm, computing capacities of quantum channels exhibits superadditivity and remains only partially understood. Finally, algorithmic (Kolmogorov) complexity offers an alternative, individual-object notion of information that is provably uncomputable, sitting uneasily alongside Shannon's ensemble-based theory.

See Also

Shannon Entropy · Kullback–Leibler Divergence · Mutual Information · Channel Capacity · Maximum Entropy Principle · Kolmogorov Complexity · Statistical Mechanics · Error-Correcting Codes

Before this

Where this leads