Overview
Information theory, founded by Shannon, asks how much a random source can be compressed and how fast data can be sent reliably through a noisy channel. Both questions have exact answers in the limit of many independent uses, and both answers are entropies: a source of entropy compresses to bits per symbol, and a channel carries at most its capacity, the largest mutual information between its input and output.
This page sets out the classical quantities, entropy, relative entropy and mutual information, the inequalities that relate them, and the two coding theorems. They are the template for quantum entropy and quantum Shannon theory, where every classical quantity has a counterpart and most, but not all, classical properties survive. The probability background is in probability theory; the construction of practical codes is in coding theory. The standard textbook is Cover and Thomas.
Intuition
The entropy is the average surprise of an outcome: a fair coin carries one bit, a coin that always lands heads carries none. Its operational meaning comes from looking at long sequences. Among the binary strings of length produced by a biased coin, essentially all of the probability sits on about "typical" strings that contain the expected proportion of heads, and they are all about equally likely. To store such a sequence one only needs to name which typical string occurred, which takes bits.
The relative entropy measures how surprised you are, on average, if you believe the data come from while they actually come from . It is zero only when the two agree and it is the rate at which evidence against accumulates per sample. The mutual information measures how much observing reduces uncertainty about . The data-processing inequality formalises the intuition that you cannot learn more about by processing , and Fano's inequality says that if you can guess from almost always, little uncertainty about remains once is known.
Prerequisites
Discrete probability, expectation and the law of large numbers; convexity and Jensen's inequality. All logarithms are base 2 unless written .
Mathematical Definitions
Let be a random variable with values in a finite set and distribution . Its Shannon entropy is
with the convention . It depends only on the distribution, so one also writes . For two random variables with joint distribution , the joint entropy is the entropy of the pair, and the conditional entropy is
the average over of the entropy of the conditional distribution . The binary entropy function is for , the entropy of a Bernoulli() variable.
Basic properties, all in chapter 2 of Cover and Thomas:
- , with iff is deterministic and iff is uniform;
- , and (conditioning does not increase entropy), with equality iff and are independent;
- chain rule , and hence subadditivity ;
- for every function .
The upper bounds follow from Gibbs' inequality. The definition is due to Shannon. The quantum generalisation is the von Neumann entropy, which equals the Shannon entropy of the eigenvalue distribution; unlike , the quantum conditional entropy can be negative.
- Random variables take values in finite sets; countable alphabets work the same way when the sums converge.
- Logarithms are base 2 (bits) unless stated; natural logarithms give nats.
For probability distributions and on a finite set , the relative entropy of with respect to is
with the conventions and for . Thus exactly when the support of is contained in the support of . It is the expectation under of the log-likelihood ratio .
with equality iff (Gibbs' inequality), but is not a metric: in general and the triangle inequality fails. Entropy and mutual information are special cases: for uniform on , , and . It is jointly convex in and cannot increase when the same stochastic map is applied to both arguments.
Operationally, is the optimal exponent with which the probability of mistaking for (accepting when the samples come from ) decays while the error probability under is kept bounded (Stein's lemma, chapter 11 of Cover and Thomas). The quantity was introduced by Kullback and Leibler. The quantum generalisation is the quantum relative entropy, with the corresponding quantum Stein lemma.
- Distributions on a finite set; logarithms base 2 unless stated.
For random variables and with joint distribution , the mutual information is
where is the Shannon entropy. Equivalently , the relative entropy between the joint distribution and the product of its marginals. For a third variable the conditional mutual information is
Properties (chapter 2 of Cover and Thomas):
- , with equality iff and are independent; likewise ;
- and ;
- chain rule ;
- if is injective, .
For a channel and input distribution , is the rate achievable with codewords drawn from , and its maximum over is the capacity in the noisy-channel coding theorem, as defined by Shannon. The quantum generalisation is the quantum mutual information.
- Random variables with finite alphabets; logarithms base 2.
Theorems
Inequalities
For probability distributions and on a finite set ,
where is the relative entropy.
Consequences, for random variables with finite alphabets:
- , with equality iff is uniform, because for the uniform distribution ;
- , with equality iff and are independent, because ;
- , since the difference is , and likewise by averaging (2) over .
The statement and these corollaries are in chapter 2 of Cover and Thomas. The quantum analogue, nonnegativity of the quantum relative entropy, is known as Klein's inequality.
- Distributions on a finite set.
Proof · Proof of Gibbs' inequality
If some has , then and . Otherwise let . Since is strictly concave, Jensen's inequality for the probability weights , , gives
Equality in the first step holds iff takes one value on , and in the second iff . Together these give , i.e. on , and off , so . The corollaries follow from the identities quoted in the statement. This is the proof in chapter 2 of Cover and Thomas.
-
Mutual information. If is a Markov chain, i.e. , then
with equality iff . In particular for every function .
-
Relative entropy. For every stochastic map (channel) and distributions on its input, with output distributions and defined likewise,
Part 1 is in chapter 2 of Cover and Thomas; part 2 follows from the log-sum inequality proved there. The quantum version of part 2, for quantum channels, is the data-processing inequality for relative entropy.
- Finite alphabets.
- For part 1, X -> Y -> Z is a Markov chain, that is X and Z are conditionally independent given Y.
Proof · Proof of the classical data-processing inequality
Part 1. By the chain rule for mutual information, in two orders,
The Markov property says that given , and are independent, so for each and . Hence , because conditional mutual information is nonnegative (Gibbs' inequality). For the chain is Markov.
Log-sum inequality. For nonnegative and positive , with and , . Indeed is convex on , and Jensen's inequality with weights at the points gives ; multiply by . Terms with and contribute nothing, and if some the left side is .
Part 2. For each output apply the log-sum inequality to and , whose sums are and :
Summing over and using gives . Part 1 is the chain-rule argument of chapter 2 of Cover and Thomas, where the log-sum inequality is also proved.
Let take values in a finite set , let be any random variable, let be an estimate of , and let . Then
where is the binary entropy function. A weaker form often suffices: , so that .
The bound is tight: equality holds when, conditioned on an error, is uniform over the wrong values, independently of . In the converse of the noisy-channel coding theorem, is a uniformly random message of bits and the channel output; Fano gives , so the error probability cannot vanish when . The inequality is in chapter 2 of Cover and Thomas.
- X takes values in a finite set with at least two elements.
- The estimate is any function of Y; by data processing, the bound also holds for any estimate X-hat with X -> Y -> X-hat Markov.
Proof · Proof of Fano's inequality
Let , so . Expand with the chain rule for entropy in two ways.
First, , because is a function of and , so .
Second, . Conditioning does not increase entropy, so . And
Given and , is determined, so the first term is . Given and , lies in , a set of elements, so its conditional entropy is at most , and so is the average over . Combining, . The weaker form uses and . For a randomised estimate with Markov, apply the result to with the identity and use , which is the data-processing inequality. This is the proof in chapter 2 of Cover and Thomas.
Here (total variation distance). The inequality is in chapter 11 of Cover and Thomas.
Proof. Let , and , so and . The map sends and to the Bernoulli distributions with parameters and , and by the data-processing inequality it does not increase the relative entropy. So it suffices to show, in nats,
(If the relative entropy is infinite and there is nothing to prove; for the second term is by the convention .) We have and
for , because . So is non-increasing on and . Hence , and dividing by gives the form in bits.
The quantum version, with the same constant and the trace norm, is the quantum Pinsker inequality. The converse direction fails: distributions can be close in total variation and have infinite relative entropy if the support condition fails.
- Distributions on a finite set; D in bits, D_e = (ln 2) D in nats.
Typicality and compression
Let be i.i.d. with distribution and entropy , and write for . Then in probability. For define the typical set
Then:
- as ; in particular it exceeds for every and all sufficiently large ;
- every has ;
- for every ;
- for all sufficiently large .
So the typical set carries almost all the probability, has about elements out of , and its elements are nearly equiprobable. Note that the single most likely sequence need not be typical. The property was stated by Shannon and proved in general (for stationary ergodic sources) by McMillan; the i.i.d. statement is chapter 3 of Cover and Thomas. Its quantum analogue, the typical subspace of with dimension about , is the core of Schumacher compression and of the HSW theorem.
- X_1, X_2, ... are independent and identically distributed with a distribution p on a finite set.
- Entropy in bits; delta > 0 is a fixed tolerance.
Proof · Proof of the asymptotic equipartition property
With probability one each lies in the support of , so is a well-defined random variable taking finitely many values. The are i.i.d. with mean and finite variance, and . The weak law of large numbers gives convergence in probability to , which is statement 1, since exactly when the average is within of .
Statement 2 is the definition of rewritten: iff .
For statement 3, by statement 2, .
For statement 4, take large enough that ; then by statement 2, .
The argument is the one in chapter 3 of Cover and Thomas.
Let be i.i.d. on a finite set with entropy . A block code of length and rate is a pair of maps and with ; its error probability is .
- Achievability. For every there are block codes of rate whose error probability tends to as .
- Strong converse. For every and every sequence of block codes with , the probability of correct decoding tends to .
The rate is in bits per source symbol. A related zero-error statement for variable-length codes: the expected length of an optimal prefix-free code for one symbol satisfies , so coding blocks of symbols achieves rate below (chapter 5 of Cover and Thomas). The theorem is due to Shannon; the block-coding form with the typical set is chapter 3 of Cover and Thomas. The quantum analogue, Schumacher compression, replaces by the von Neumann entropy.
- An i.i.d. source on a finite alphabet with entropy H in bits.
- Fixed-length block coding with error probability that must vanish as n grows; the variable-length zero-error version is a separate statement quoted below.
Proof · Proof of the source coding theorem
Write for the typical set of the asymptotic equipartition property.
Achievability. Let and . Then , so there is an injective map ; extend arbitrarily to all of and let invert it on . Every is recovered, so the error probability is at most , which tends to .
Strong converse. Let and . Any decoder with has an image of at most sequences, and decoding is correct only if . Using the upper bound on ,
and both terms tend to . This follows chapter 3 of Cover and Thomas.
Channel coding
A discrete memoryless channel is used independently on each symbol, as the binary symmetric channel and the binary erasure channel are.
Let be a discrete memoryless channel with input alphabet and output alphabet . Define its capacity
the maximum over input distributions of the mutual information, in bits, between the input and the output distributed according to .
A code of length and rate is a set of codewords in together with a decoder .
- Achievability. For every and every there is, for all sufficiently large , a code of length and rate whose probability of decoding error is at most for every transmitted codeword.
- Converse. If , there is a constant such that every code of rate , of any length, has average probability of decoding error at least when the codewords are used with equal probability.
The theorem is due to Shannon, whose argument for achievability chooses the codewords at random; a complete proof of both parts, by joint typicality and Fano's inequality, is in chapter 7 of Cover and Thomas. No proof is recorded here. The special case of the erasure channel, with linear codes, is proved in full in a separate record.
The theorem is an existence statement. It does not say how to find the codes, and the random codes in its proof have no efficient decoder.
- A discrete memoryless channel, that is, finite input and output alphabets and independent, identical action on each transmitted symbol.
- No feedback; the encoder and decoder may use arbitrarily long blocks and unlimited computation.
- The converse stated here is the weak converse (error probability bounded away from zero).
For the binary symmetric channel, , because given the output is flipped with probability . The entropy is at most 1 bit, with equality for a uniform input, which gives the formula; by the noisy-channel coding theorem this maximum of the mutual information is the capacity. The value appears as an example in Shannon's paper.
The capacity is 1 at , falls to 0 at and is symmetric under . Numerically , so a channel that flips 11% of the bits still supports rates up to about one half.
- Memoryless binary symmetric channel with crossover probability ; .
- Capacity in bits per channel use, in the sense of the noisy-channel coding theorem.
Worked Examples
Entropy and an optimal code
Let take values with probabilities . Then
less than the bits of a uniform variable on four values. The prefix-free code , , , has expected length bits, meeting the lower bound of the source coding theorem exactly because every probability is a power of .
Mutual information through a binary symmetric channel
Send a uniformly random bit through with . The output is uniform, so , and . Numerically, , so
The uniform input is optimal for this channel, so this is its capacity: about two channel uses are needed per message bit, however good the code.
Pinsker on two coins
For and , bits, and . Pinsker's inequality asserts bits, which holds and is nearly tight because the distributions are close. In the reverse direction, bits, illustrating that relative entropy is not symmetric.
Conditioning can increase mutual information
Let and be independent uniform bits and . Then , but given , determines , so bit. Unlike entropy, mutual information is not monotone under conditioning in either direction; this example is the classical core of the one-time pad.
Applications
- Quantum entropy. The von Neumann entropy, quantum relative entropy and quantum mutual information reduce to the classical quantities for commuting states.
- Capacities. The Holevo bound and the HSW theorem are the quantum versions of the converse and achievability of channel coding.
- Hypothesis testing. Relative entropy is the Stein exponent, and its quantum version appears in the quantum Stein lemma and in one-shot theory.
- Cryptography. Key rates such as the Devetak–Winter rate are differences of entropies, and privacy amplification uses the leftover hashing lemma.
- Decoding. Error rates of decoders, the hashing bound and the capacities of the binary symmetric and erasure channels are expressed with .
Limitations and Common Pitfalls
- Units. Bits for , nats for ; exponential error bounds are often stated in nats while entropies are quoted in bits.
- Relative entropy is not a distance. It is asymmetric, violates the triangle inequality and is infinite whenever the first distribution has weight outside the support of the second.
- Asymptotic statements. The coding theorems describe limits of many independent uses. At finite block length, or for correlated sources, the relevant quantities are one-shot entropies and second-order corrections (one-shot theory).
- The most likely sequence is usually not typical. For a coin with , the all-ones string is the single most probable sequence of length , but for it , while . For any it lies outside the typical set, which consists of strings with about ones, each individually less likely.
- Classical intuitions that fail quantumly. and always hold classically, but the quantum conditional entropy can be negative, and capacities of quantum channels need not be additive.
- Entropy is a property of a distribution, not of a single string. The information content of one given string is the subject of algorithmic (Kolmogorov) complexity, a different theory.