Notes It
Notes It
Billy Fang
Instructor: Thomas Courtade
Fall 2016
These are my personal notes from an information theory course taught by Prof. Thomas Courtade. Most of the
material is from [1]. Any errors are mine.
Contents
1 Entropy 1
4 Data compression 5
5 Channel capacity 6
6 Differential entropy 14
7 Gaussian channel 16
H(X | Y ) ≤ H(X) (conditioning reduces uncertainty), but it is not always true that H(X | Y = y) ≤ H(X) for
each y (only true on average).
1 2
Pinsker’s inequality: D(pkq) ≥ 2 ln 2 kp − qk1 .
Entropy H(p1 , . . . , pn ) is concave in (p1 , . . . , pn ).
(i)
H(X) ≤ log|X |. Proof: use Jensen’s inequality. Let pX = (p1 , . . . , pn ) and let pX :=
(i)
(pi , . . . , pn , p1 , . . . , pn−1 ). Then H(pX ) = H(pX ). So,
n n
!
X 1 (i) 1 X (i)
H(X) = H(pX ) ≤ H p = H(1/n, . . . , 1/n) = log n.
i=1
n n i=1 X
I(X; Y ) is concave in pX for fixed pY |X . It is convex in pY |X for fixed pX . To see the first one, note I(X; Y ) =
H(Y ) − H(Y | X). For fixedP pY |X , we have H(Y | X) is linear in pX , and H(Y ) is concave function composed
with a linear function pY = x pY |X (y)pX (x) of pX .
Data processing inequality: if X → Y → Z is a Markov chain (X and Z independent given Y ), then I(X; Z) ≤
I(X; Y ).
We discuss a connection between information and estimation. Consider the Markov chain X → Y → X(Y b )
where Y is the noisy observation of X, and X(Y ) is an estimator of X based on Y . Let Pe = P(X 6= X(Y )).
b b
H(E, X | X)
b = H(X | X)
b + H(E | X, X)
b
= H(X | X)
b
and
H(E, X | X)
b = H(E | X)
b + H(X | E, X)
b
≤ H(E) + pe H(X | X,
b E = 1) + (1 − pe )H(X | X,
b E = 0)
= H(Pe ) + pe log|X |
b ) 6= X), we have
Corollary 1.2. With Pe := minXb P(X(Y
1
b ≤ I(X; Y ) which implies H(X | X)
Proof. By the data-processing inequality, I(X; X) b ≥ H(X | Y ).
We now clarify the interpretation of “entropy is the average number of bits needed to describe a random variable.”
Consider a function f : X → {0, 1}∗ that maps the alphabet to arbitrary length bit strings. We want f to be injec-
tive (able to distinguish between letters in the alphabet). Let `(f (x)) be the length of this description of x. Then
E[`(f (X))] is the average length of this description.
X
E[`(f (X))] = p(x)`(f (x))
x
X p(x)
= H(X) + p(x) log
x
2−`(f (x))
X X 0 X p(x)
= H(X) − p(x) log 2−`(f (x )) + p(x) log
2−`(f (x)) / 2−`(f (x0 ))
P
x x0 x x0
X 0
= H(X) − log 2−`(f (x )) + D(pX kQ)
x0
X 0
≥ H(X) − log 2−`(f (x )) .
x0
Proposition 1.3. X 0
2−`(f (x )) ≤ log 2|X |.
x0
Proof. Consider maximizing the sum on the left-hand side. Respecting injectivity of f , this is the first |X | terms of
the series
2−0 + 2−1 + 2−1 + 2−2 + 2−2 + 2−2 + 2−2 + · · ·
Suppose we observe i.i.d. X1 , . . . , Xn . The alphabet has size |X |n . Any description of these n outcomes requires
at least H(X n ) − log(1 + n log|X|) bits. Using independence, we have the following lower bound on the average
number of bits per outcome.
1 1
E[`(fn (X n ))] ≥ H(X1 ) − log(1 + n log|X |). = H(X) − O(log(n)/n).
n n
Suppose X = {a, b, c} and f (a) = 0, f (b) = 1, and f (c) = 01. Concatenating is no longer injective: 01101 could
correspond to abbc or cbc. If we want uniquely decodable f , then the upper bound of the previous proposition is 1.
Consider X being uniform on the above alphabet. Let f (a) = Λ, f (b) = 0, and f (c) = 1. Then E[`(f (X))] =
2/3 < 1.58 ≈ H(X).
So pX n (xn ) ≈ 2−nH(X) .
2
Theorem 2.1.
1 p
− log pX n (xn ) → H(X).
n
Last time we saw a few examples where the formula for entropy “magically” appeared. One was that if f : X →
{0, 1}∗ is injective, then E`(f (X)) ≥ H(X) − log log 2|X |. Today we will show that there exists an f ∗ such that
E`(f ∗ (X)) . H(X).
We also saw that if we observe an i.i.d. sequence of Bern(1 − p) random variables, then the “typical” sequence of
length n has n(1 − p) ones and np zeros, and moreover pX n (xn ) ≈ 2−nH(X) .
To formally define “typical,” we will work backwards from the above example.
(n)
Definition 2.2. The typical set A ⊂ X n is defined as
A(n)
= {xn : 2−n(H(X)+) ≤ pX n (xn ) ≤ 2−n(H(X)−) }.
Proposition 2.3 (Properties of typical sets).
(n)
1. x ∈ A ⇐⇒ H(X) − ≤ − n1 log pX n (xn ) ≤ H(X) + .
(n)
2. P(X n ∈ A ) → 1.
(n)
3. |A | ≤ 2n(H(X)+) .
(n)
4. |A | ≥ (1 − 0 )2n(H(X)−) for n sufficiently large.
4. X
−n(H(X)−)
1 − ≤ P (X ∈ A(n)
)= pX n (x) ≤ |A(n)
|2 .
(n)
x∈A
(n) (n)
In summary, A together has almost all the proability mass, the probability on sequences in A is roughly
uniform, and the cardinality is roughly 2nH(X) .
(n) (n) (n)
If Bδ is the smallest set with probability ≥ 1 − δ, then |Bδ | ≈ |A | in some sense. More precisely,
1 (n)
log|Bδ | > H(X) − δ 0
n
Proof.
(n)
1 − − δ ≤ P (Bδ ∩ A(n)
) union bound
X
n
= pX n (x )
xn ∈A∩B
X
≤ 2−n(H(X)−)
xn ∈A∩B
(n)
≤ |Bδ |2−n(H(X)−)
(n)
|Bδ | ≥ (1 − − δ)2n(H(X)−)
1 (n)
log|Bδ | > H(X) − + log(1 − − δ)
n
3
We now describe a scheme to describe X with H(X) bits on average: the typical set encoding.
(n) (n)
If we label all sequences in A , we need log|A | + 1 bits per label.
(n) (n) (n)
To encode x ∈ A , we put a flag 1 in front of the label (length log|A | + 2. If x ∈
/ A , we put a flag 0 in front
of the binary representation of the sequence (length n(log|X| + 1) + 1).
1 1 1
E`(f (X n )) ≤ P (A(n) (n)
)(log|A | + 2) + (1 − P (A(n)
))(n(log|X | + 1) + 1)
n n n
1
≤ (H(X) + ) + + δ(n)((log|X | + 1) + 1/n)
n
≤ H(X) + 2
Although this scheme is not practical, we see that we get a matching upper bound to our earlier lower bound H(X) −
log log 2|X | on the expected length.
The Second Law of Thermodynamics: the entropy of an isolated system is not decreasing. We might model such
a system with a Markov process. [Example: Ehrenfest gas system?]
Suppose we start a Markov chain in two different states, and let their state distributions at time n be Pn and Qn
respectively, then
D(Pn+1 kQn+1 ) ≤ D(Pn kQn ).
If Pn is stationary, D(Pn kπ) is decreasing.
4
4 Data compression
We have seen that it takes H(X) bits on average to describe X. This is the fundamental idea behind data com-
pression.
From AEP, it takes about nH(X) bits to represent X1 , . . . , Xn . But this scheme (using typical set) is wildly
impractical.
Let c : X → {0, 1}∗ be a source code. We are interested in L(c) = x pX (x)`(c(x)).
P
x pX (x) c(x) `(c(x))
a 1/5 00 2
For example, has L(c) = 1.6 and H(X) = 1.52.
b 2/5 01 2
c 2/5 1 1
This defines the extension code c∗ defined by c∗ (x1 · · · xn ) = c(x1 ) · · · c(xn ).
A nonsingular code c is an injective code. A code is uniquely decodable if c∗ is nonsingular (injective).
A code is prefix-free (a.k.a. instantaneous) if no code word is a prefix of any other code word. Confusingly, such
codes are sometimes called prefix codes.
Proof. Sort `1 ≤ · · · ≤ `N . Draw a binary tree of code words. If `1 = 2 for example, let the first code word be 00 and
prune the children at that node. Then choose the next smallest available word of length `2 and so on. The inequality
guarantees that this is possible and we don’t run out of words.
We now show any prefix code satisfies the inequality. Consider inputting a sequence of random coin flips into a
decoder which spits out x if the input is a code word.
[ X X
1 ≥ P(some x comes out) = P {x comes out} = P(x comes out) = 2−`(c(x))
x∈X x∈X x∈X
2−`i ≤ 1.
P
Theorem 4.2 (McMillan inequality). Any uniquely decodable code has codeword lengths satisfying i
We prove McMillan’s inequality on the homework. Recall that for any f , we proved
X
E[`(f (X))] = H(X) + D(pX kq) − log 2−`(f (x))
x
where q(x) ∝ 2−`(f (x)) . If c is uniquely decodable, then applying McMillan’s inequality shows that E`(c(X)) ≥
H(X).
How do we design good codes? Consider choosing `i to minimize i pX (i)`i subject to i 2−`i ≤ 1. Then the
P P
optimal `i s satisfy `i = − log pX (i). This is natural when considering D(pX kq).
However, our code lengths must be integers, so we can consider instead `i = d− log pX (i)e.
X X
pX (i)`i ≤ pX (i)(1 − log pX (i)) = H(X) + 1.
i i
Theorem 4.3. Any uniquely decodable code c satisfies E`(c(X)) ≥ H(X) (impossibility), and there exists a code c∗
such that E`(c∗ (X)) ≤ H(X) + 1 (achievability).
5
At each stage we group the two least probable symbols into one and add their probabilities. We start with {a}, {b},
and {c}. After the first stage we have {a, b} w.p. 3/5 and c w.p. 2/5. Finally, we merge everything to get {a, b, c}. At
each grouping, label the edges 0 and 1. Read backwards to get the code: a = 00, b = 01, and c = 1.
E`(c(X)) = 2/5 + 4/5 + 2/5 = 8/5 ≈ 1.6. While H(X) ≈ 0.722.
Theorem 4.4. Huffman coding is optimal among all uniquely decodable codes. That is, if c∗ is the Huffman code,
then E`(c∗ (X)) ≤ E`(c(X)) for any uniquely decodable code c.
5 Channel capacity
The communication problem:
Assumptions
1. Messages are random variables uniformly distributed over {1, . . . , M }.
2. Channel has known statistical properties. Input X and output Y , know PY |X . Justification: in real life we can
take measurements.
6
3. Discrete time, discrete alphabet, memoryless channel. Statistics of PY |X do not change over time. [If X1 , X2
are i.i.d. and input sequentially, then output Y1 , Y2 are i.i.d.]
Example 5.1 (Binary symmetric channel). The binary symmetric channel BSC(p) takes binary input x ∈ {0, 1}
and outputs either x or 1 − x with probability 1 − p and p respectively.
A (M, n)-block code for the channel (X , PY |X , Y) uses n symbols from X to transmit one of M messages Wi ,
i = 1, . . . , M .
X n (W ) Yn c (Y n )
W → (M, n)-block code −→ PY n |X n −→ decoder → W
The rate of an (M, n) code is R = lognM = number of information bits
number of channel uses = bits/channel use. We also write an (M, n) code
nR
as a (2 , n) code.
A good code should have high rate and good reliability, but these are in conflict.
A rate R is achievable if there exists a sequence of (2nR , n) such that
c 6= Wi | W = Wi ) → 0
max P(W
i
C = max I(X; Y ).
PX
Properties of C.
1. C ≥ 0.
2. C ≤ min(log|X |, log|Y|). (Just note I(X; Y ) ≤ H(X) ≤ log|X |.) This is equality when the channel is a
deterministic map from X → Y, and |Y| = |X |.
3. Recall I(X; Y ) is concave in PX for fixed PY |X . Computing C is a convex optimization problem.
Example 5.4 (Binary symmetric channel). Consider BSC(p). Note I(X; Y ) = H(Y ) − H(Y | X) = H(Y ) −
H(p) ≤ 1 − H(p) for any distribution on X. If X ∼ Ber(1/2), then Y ∼ Ber(1/2), which gives equality, so this is
the maximizing distribution. C = 1 − H(p). For example if p = 0.1, we have C ≈ 0.6.
Example 5.5 (Binary erasure channel). Consider the binary erasure channel BEC(p). Input x ∈ {0, 1} and output x
with probability 1 − p or e (erasure) with probability p. Letting E be the indicator for erasure, we have
I(X; Y ) = H(Y ) − H(Y | X) = H(Y ) − H(p)
= H(Y, E) − H(p)
= H(E) + H(Y | E) − H(p)
= H(Y | E)
= pH(Y | E = 1) + (1 − p)H(Y | E = 0)
≤ (1 − p).
7
Taking X ∼ Ber(1/2) gives equality again, so C = 1 − p. This makes sense: if we knew where the erasures were
(proportion p of the time), we can send perfectly. What is surprising that we don’t need to know where the erasures
are.
A rate R is achievable if there exists a sequence of (2nR , n) codes such that maxi P(W c 6= Wi | W = Wi ) → 0 as
n → ∞. The channel capacity C is a supremum of achievable rates; can be interpreted as the maximum rate at which
information can be transmitted reliably.
We showed that the channel capacities for BSC(p) and BEC(p) are 1 − H(p) nad 1 − p respectively.
Heuristic explanation for channel capacity of BEC(p): First we argue an upper bound on achievable rates R.
Suppose we have extra information: we know the location of the [on average] ≈ pn erasures. Then we could send [on
average] ≈ (1 − p)n bits reliably, i.e. 1 − p bits per channel use. This implies R ≤ 1 − p for achievable R.
Now, how do we actually achieve this without the actual information?
Consider a G ∈ {0, 1}n×(1−p−)n that is full rank (over F2 ). Let X n (W ) := GW ∈ {0, 1}n where W ∈
{0, 1}(1−p−)n . Once we send it through the channel, [on average] proportion ≈ p bits are erased, so after the channel
we have n(1 − p) bits that are not erased. Then we can invert the system since 1 − p − < 1 − p. Regarding finding
a G, one can show that with i.i.d. Bernoulli entries, the resulting matrix is full rank with high probability. Note that in
this scheme, the probability of error is the probability that the number of erasures is > (p + )n.
Example 5.6 (Noisy typewriter). X = {A, . . . , F }, and for each letter X, the distribution Y | X is equally likely to
be X or X + 1.
I(X; Y ) = H(Y ) − H(Y | X) = H(Y ) − 1 ≤ log(6) − 1 = log 3.
If we choose PX to be uniform on {A, C, E}, then we have equality I(X; Y ) = log 3.
Preview of Achievability in Channel Coding Theorem: all channels look like the noisy typewriter for n sufficiently
large.
Example 5.7√(Additive Gaussian white noise). Let PY |X ∼ N (X, 1). Then the typical set is a ball centered at X n on
the order of n. Then a simple encoding/decoding scheme is to choose (for the input distribution) a packing of the
space so that these balls are disjoint; decoding just chooses the nearest center.
We now prove the theorem.
Proof of channel coding theorem (converse/impossibility). We begin with the converse: if R is achievable, then R ≤
C := maxPX I(X; Y ). If R is achievable, there exists a sequence of (2nR , n) code with maxi P(W c (n) 6= Wi |
(n) (n) (n)
W = Wi ) = n with n → 0. This implies P(W
c 6= W ) ≤ n (average is less than maximum).
Note
nR = H(W (n) )
= H(W (n) | W
c (n) ) + I(W (n) ; W
c (n) )
≤ 1 + n nR + I(W (n) ; W
c (n) ) Fano, W
c is estimator of W
8
n
X
= 1 + n nR + I(Xi ; Yi )
i=1
≤ 1 + n nR + nC.
• The use of Fano’s inequality says we should use the best estimator W
c of W ...
• The next inequality implies the Yi should be close to independent (i.e. the Xi should be close to independence).
• The last inequality implies that the distribution of X n is close to i.i.d. from argmaxPX I(X; Y ). [Capacity-
achieving input distribution (CAID).]
(n)
The set A of jointly typical sequences (X n , Y n ) with respect to a distribution PXY is the set of n-sequences
with empirical entropies -close to true entropy, that is,
(
1
A(n)
= (xn , y n ) : − log pX n ,Y n (xn , y n ) − H(X, Y ) < ,
n
1
− log pX n (xn ) − H(X) < ,
n
)
1 n
− log pY n (y ) − H(Y ) <
n
∗
If a rate R is close to C, then the function X n (W ) ought to be “random” (specifically, i.i.d. from PX , the optimizer
of I(X; Y )).
Well-known codes like algebraic codes (Reed-Solomon, Gaulay, PCH) have a lot of structure and redundancy for
the sake of simple decoding. However, this is at odds with the above intuition of a capacity-achieving code.
Today we will prove the achievability direction of the channel coding theorem.
The third statement is new. Independence causes the probability of being in the typical set to be vanishing. Note
all pairings of typical X sequences and typical Y sequences are not necessarily jointly typical (in fact, most of them
are not).
9
Proof. The first statement follows by the law of large numbers. The second statement follows by
X
−n(H(X,Y )+)
1≥ p(xn , y n ) ≥ |A(n)
(X, Y )|2 .
xn ,y n
Proof of achievability in channel coding theorem. We now prove that all rates R < C are achievable. This is a non-
constructive proof. We will use the probabilistic method: we will show that some object in a finite class C satisfies
property P by exhibiting a distribution over C, drawing an object from this distribution, and show that this object
satisfies P with probability > 0.
In our setting C is a set of (2nR , R) codes and P is “code has small probability of error.”
We will use random coding. Fix some PX and > 0 and R. Generate a (2nR , n) code at random according to PX .
The codebook is nR
C = [Xi (w)]i,w ∈ R2 ×n .
The wth row of C is the codeword for the wth message. Each letter of each code word is generated i.i.d. from PX , so
nR
2Y n
Y
P(C) = PX (Xi (w)).
w=1 i=1
We have decided the encoding scheme. For decoding, we will use typical set decoding. The receiver declares that
W
c was sent if both of the following happen.
(n)
c ), Y n ) ∈ A (X, Y ), that is, the received message Y n is jointly typical with code word X n (W
1. (X n (W c ).
10
The average over all codes is
X
Perror = P(C)P(n) (C)
C
nR
2
X 1 X
= P(C) λw (C)
2nR w=1
C
nR
2
1 XX
= P(C)λw (C)
2nR w=1
C
X
= P(C)λ1 (C) rows of C are exchangeable
C
= P(error | W = 1). error prob. averaged over all codes
(n)
Define error events Ei = {(X n (i), Y n ) ∈ A (X, Y )} for i = 1, . . . , 2nR . Continuing from above,
Let X n be i.i.d. Bern(1/2). Suppose Y n is obtained by passing X n through BSC(α). [That is, Yi is equal to Xi
with probability 1 − α, and is flipped with probability α.] For any b : {0, 1}n → {0, 1} (one-bit function), is it true
that I(b(X n ); Y n ) ≤ 1 − H(α) = I(X1 ; Y1 )? This is the “most informative function conjecture.”
In the last few lectures we proved the channel coding theorem, which stated that the channel capacity is
maxPX I(X; Y ).
• Converse: If R is achievable, then R < C. This holds using either definition of achievability (involving maximal
c 6= Wi | W = Wi ) or average probability of error P (W
probability of error maxi P (W c 6= W )).
We just need to tidy up the achievability result by proving the version with maximum probability of error. This is an
application of Markov’s inequality. Note
nR
2
X
c 6= W ) =
P (W c 6= Wi | W = Wi )P (W = Wi )
P (W
i=1
11
Since messages are uniformly distributed,
c 6 W)
c 6= Wi | W = Wi ) ≥ λ}/2nR ≤ P (W =
#{i : P (W .
λ
c 6= W ) gives
Taking λ = 2P (W
c 6= W )} ≤ 2nR /2.
c 6= Wi | W = Wi ) ≥ 2P (W
#{i : P (W
If we throw away these bad messages (left-hand side), then the new rate is
c0 6= W0i | W0 = W0i ) ≤ 2P (W
max P (W c 6= W ) → 0.
i
What is the rate of information sent from eye to brain? Measure signal X entering eye, signal Y entering brain,
estimate I(X; Y ), gives upper bound on rate. [Estimating I(X; Y ) needs some shift to align due to delay, quantize
time, etc.]
Suppose that we are the encoder that sends Xi through a channel, which sends Yi to a decoder. What if we get
feedback: we see Yi (what the decoder receives)? We argued before that in the binary erasure channel, the capacity
with feedback is the same. Is this true in general? [We know trivially that capacity with feedback must be at least as
large as the capacity without feedback: just ignore the feedback.]
More explicitly, the encoder sends Xi , which can depend on W , as well as X i−1 and Y i−1 .
Theorem 5.9. The feedback does not improve the channel capacity. However, it can simplify the encoding scheme. It
can also get us to capacity much more quickly. That is, Pe (best code) ≈ 2−nE without feedback, but with feedback
nE 0
Pe (best code) ≈ 2−2 .
≤ I(W ; W
c ) + nRn + 1 Fano
X
= (H(Yi ) − H(Yi | W, Y i−1 , Xi )) + nRn + 1 Xi is function of (W, Y i−1 )
i
X
= (H(Yi ) − H(Yi | Xi )) + nRn + 1 Yi is conditionally independent of all past things given Xi
i
X
= I(Xi ; Yi ) + nRn + 1
i
≤ n max I(X; Y ) + nRn + 1.
PX
12
Thus R ≤ C.
Remark: In the channel coding theorem, we had
n n
P
We then used H(Y | X ) = i H(Yi | Xi ) because the Yi were conditionally independent given the corresponding
Xi . This is no longer the case with feedback.
Preview of another problem (to be continued later):
Consider the following compression example. [No channel.] Suppose we have X n and Y n are correlated, and we
want to encode each separately, and then a decoder takes both. (If the first encoder sents nRX bits and the second
sends nRY , then the rate is RX + RY .) How much worse is this than encoding (X n , Y n ) together? Chapter 15.4.
We say RX and RY are achievable if there exists a sequence of functions f : X n → [2nRX ] and g : Y n → [2nRY ]
and φ : [2nRX ] × [2nRY ] → X n × Y n such that
P (φ(f (X n ), g(Y n )) 6= (X n , Y n )) → 0
as n → ∞. (X b n , Yb n ) := φ(f (X n ), g(Y n )). The achievable rate region is the closure of achievable rates.
Recall that if RX ≥ H(X) then we can send the information losslessly. So the achievable rate region definitely
contains [RX , ∞) × [RY , ∞). Considering the special case where we can encode everything together, we see that the
achievable rate region must lie in the region {RX + RY ≥ H(X, Y )}.
The answer: any rates satisfying RX ≥ H(X | Y ), RY ≥ H(Y | X), and RX + RY ≥ H(X, Y ).
In channel coding, high rate is desirable, but hard because of the channel. In compression, low rate is desirable
(communicate using fewer bits) but hard. That is why achievable rates in channel coding has an upper bound, while
in compression there is a lower bound.
We will discuss Problem 4 on the midterm.
(X n , Y n ) are drawn i.i.d. from some distribution. Y n is encoded into f (Y n ) ∈ {0, 1}nR . The decoder receives
both f (Y n ) and X n , and gives an estimate Yb n .
(n)
The probability of error is Pe = P (b y n (X n , f (Y n ) 6= Y n ). We say R is achievable if there exists a sequence of
nR (n)
(2 , n) codes with Pe → 0.
First, we prove that if R is achievable, then R ≥ H(Y | X).
nR ≥ H(f (Y n ))
≥ H(f (Y n ) | X n ) conditioning reduces entropy
n n n n n n
= H(Y , f (Y ) | X ) − H(Y | f (Y ), X ) chain rule
n n n
≥ H(Y , f (Y ) | X ) − (nPe(n) log|Y| + 1)
n n n n n
= H(Y | X ) + H(f (Y ) | Y , X ) − nn
= nH(Y | X) + 0 − nn .
(n) (n)
Next, we prove a lemma about typical sets. We define A (Y | xn ) = {y n : (xn , y n ) ∈ A (X, Y )}. We prove
(n)
|A (Y | xn )| ≤ 2nH(Y |X)+2) .
2−n(H(X)−) ≥ p(xn )
X
≥ p(xn , y n )
(n)
y n :(xn ,y n )∈A (X,Y )
X
≥ 2−n(H(X,Y )+)
(n)
y n :(xn ,y n )∈A (X,Y )
= |A(n)
(Y | x )|2−n(H(X,Y )+)
n
13
6 Differential entropy
R
The differentiable entropy of a continuous random variable with density f is h(X) := − f (x) log f (x) dx =
−E log f (X).
If X is discrete and Y is continuous, then I(X; Y ) = H(X) − H(X | Y ) = h(Y ) − h(Y | X).
Ra
Example 6.1 (Uniform). If X is uniform on [0, a], then h(X) = − 0 a1 log a1 dx = log a. In particular, h(X) can be
negative!
P∞
Why can entropy be negative? Consider approximating the integral by − i=−∞ N1 f (i/N ) log f (i/N ). Consider
[X]N , a discretized version of f taking values 1/N with probabilities f (i/N )/N . Then the above approximation to
the integral is H([X]N ) − log N = H([X]N ) − H([U ]N ), where [U ]N is the discretization of a Unif(0, 1) random
variable. This is the “differential” in the name: it is in some sense the difference in discrete entropy of quantized
versions of X and U .
The relative entropy is D(P kQ) = p(x) log dp dp
R
dq (x) dx = EP log dq (X). Note that we can rewrite this as
R dp dp
dq (x) log dq (x) dq(x). So, differential entropy can be written as −D(P k dx) where “dx” denotes the Lebesgue
measure.
2 2
Example 6.2 (Gaussian). Let f (x) = √ 1
2πσ 2
e−x /2σ .
Z
1
h(X) = f (x) log dx
f (x)
x2
Z
1
= log 2πσ 2 + f (x) log(e) 2 dx
2 2σ
1 1
= log 2πσ 2 + log e
2 2
1 2
= log 2πeσ
2
R
Joint density is h(X1 , . . . , Xn ) = − f log f where f is the joint density.
Let f (x) = (2π)−n/2 |K|−1/2 exp − 12 (x − µ)> K −1 (x − µ) .
Example 6.3 (Multivariate Gaussian).
Z
1
h(X) = f log
f
1 1 1
= log(2π)n |K| + log(e) + log(e)E(X − µ)K −1 (X − µ)
2 2 2
1 n
= log(2π)n |K| + log e trace trick
2 2
1
= log(2πe)n |K|.
2
Note that µ does not appear. This is because entropy is invariant to shifting.
R
Conditional differential entropy is h(Y | X) = − fX,Y (x, y) log fY |X (y | x) dy dx = −E log fY |X (Y | X).
Chain rule: h(Y, X) = h(X) + h(Y | X).
Relative entropy: if supp(f ) ⊂ supp(g), D(f kg) = f log fg ≥ 0 by Jensen’s inequality.
R
Mutual information is I(X; Y ) = D(fXY kfX fY ) = h(X) − h(X | Y ) ≥ 0. From this we see conditioning still
decreases entropy. Pn Pn
We still have h(X1 , . . . , Xn ) = i=1 h(Xi | X1 , . . . , Xi−1 ) ≤ i=1 h(Xi ).
Also, h(X + c) = h(X) and h(aX) = h(X) + log|a|. [Recall if Y = aX then fY (y) = fX (y/a)/|a|.] More
generally, for a matrix A, h(AX) = h(X) + log|A|.
Aside:
14
Proposition 6.4 (Entropy power inequality). Let X and Y be independent random vectors on Rn .
Suppose X is uniform on some set A, so fX (x) = 1/ vol(A)1A . Then h(X) = log vol(A). Similarly if Y is
uniform on another set B, then h(Y ) = log vol(B). Then, the entropy power inequality implies
The Brunn-Minkowski inequality states vol(A + B)1/n ≥ vol(A)1/n + vol(B)1/n , where A + B is the Minkowski
sum {a + b : a ∈ A, b ∈ B}. If we take 22h(X+Y )/n ≈ vol(A + B)2/n (note this is not true, due to the convoluting),
then we see that the entropy power inequality suggests a stronger inequality than the Brunn-Minkowski inequality.
Rough volume argument for strong converse of channel coding: if R > C, The number of typical y n is ≈ 2nH(Y ) .
For each xn , number of conditionally typical y n is 2nH(Y |X) . If these sets are disjoint, the number of sets in y n is
about 2nI(X;Y ) . If we have R > C then we have overlap.
If X is discrete and Y is continuous, no notion of joint entropy. However, we can talk about mutual information.
For general random variables, we have another equivalent definition of mutual information.
where the supremum is over all partitions. Note that this is essentially the definition of Lebesgue integration from
approximation by simple functions. For continuous Y , we recover the earlier definition.
I(X; Y ) = sup H([Y ]N )−H([Y ]N | [X]N ) ≈ h(Y )+H([U ]N )−h(Y | [X]N )−H([U ]N ) → h(Y )−h(Y | X).
N
The fact that mutual information can be defined between discrete and continuous random variables is good in
practice. Consider a codeword X n ∈ [2nR ] being sent through a channel; such channels usually produce continuous
output.
Last time we showed for X ∼ N (µ, K), we have h(X) = 21 log(2πe)n |K|.
So, the Gaussian distribution maximizes entropy under a second moment constraint.
Aside: Note that for the discrete case, uniform distribution over finite alphabet maximizes entropy without moment
conditions. It does not usually make sense to impose moment conditions since we usually do not care about the values
of X, unlike the continuous case. For nonnegative integers with a mean constraint, geometric distribution maximizes
entropy.
> −1
Proof. Let φ(x) = (2π)−n/2 |K|−1/2 e−x K x/2 be the Gaussian density and f arbitrary. [WLOG both f and φ
have zero mean.] Then − loge φ = 12 log[(2π)n |K|] + 12 x> K −1 x.
15
0 ≤ De (f kφ)
Z
f
= f loge
φ
Z
= − f loge φ − he (f )
7 Gaussian channel
The Gaussian channel takes input X and outputs Y = X + Z where Z ∼ N (0, σ 2 ) is independent of X.
We have supPX I(X; Y ) = ∞ because we do not have constraints on X. We could spread the distribution of X
so widely such that the Gaussian Z does not perturb by much, and Y can easily be decoded.
We consider instead supPX :EX 2 ≤P I(X; Y ). [WLOG we assume X is zero mean; shifting does not change any-
thing.] We have
Equality is attained by X ∼ N (0, P ), so C = 12 log 1 + σP2 . The ratio p/σ 2 is the signal-to-noise (SNR).
For the Gaussian channel, a (2nR , n, P ) code c is a map from w ∈ [2nR ] and outputs X n (w) ∈ Rn such that
kX (w)k2 ≤ nP . [The idea is that we have limited energy; we cannot amplify arbitrarily large.]
n
nR ≤ H(W )
≤ I(X n ; Y n ) + nPe(n) R + 1 data proc., Fano
Xn
≤ I(Xi ; Yi ) + 1 + nPe(n) R
i=1
n
1X
R≤ I(Xi ; Yi ) + n
n i=1
n 2
We cannot take the supremum over PX because we have the constraint
1
PnkX (w)k ≤ nP . WeR use the fact that for
fixed PY |X , the map PX 7→ I(X; Y ) is concave. We define PX = n i=1 PXi . Then PY = PY |X dPX . Then
n
1X
I(Xi ; Yi ) ≤ I(X; Y ) ≤ max2 I(X; Y )
n i=1 PX :EX ≤P
16
Pn
because EX 2 = n1 i=1 EXi2 ≤ P . With a little more work, the constraint kX n (W )k2 ≤ nP could be relaxed to
hold on average over messages W .
Let X1 , X2 , . . . be i.i.d. with density f , mean zero, and second moment equal to 1. The central limit theorem
states
n
1 X d
Sn := √ Xi → N (0, 1).
n i=1
Note that Sn all have the same second moment 1. We suspect h(Sn ) is increasing, since the limiting distribution is
Gaussian.
Recall the entropy power inequality, which implies
√ 1 2h(X1 )
22h((X1 +X2 )/ 2)
= 22(h(X1 +X2 )−log 2) ≥ (2 + 22h(X2 ) ) = 22h(X1 ) .
2
This argument shows h(S2k ) ≥ h(S2` ) for k ≥ `.
But does h(Sn ) increase monotonically? This was an open problem since Shannon, and solved in 2004.
Note that h(Sm ) ≥ h(Sn ) is equivalent to D(Sm kN (0, 1)) ≥ D(Sn kN (0, 1)). [Convergence in entropy implies
convergence in distribution. See Pinsker?] So a strong central limit theorem holds.
This last inequality is Lieb’s inequality, and we have shown it is a consequence of the entropy power inequality. This
2h(U )
is actually equivalent to the entropy power inequality: choose λ = 22h(U2 ) +22h(V ) .1 The latter form is more convenient
for proving, but the original form is more convenient for applications.
Without loss of generality, we may assume the densities of X and Y do not vanish. [Else convolve with a Gaussian
with low variance; does not change much.]
22h(U )/n
1 Suppose we want to prove the n-dimensional EPI 22h(U +V )/n ≥ 22h(U )/n + 22h(V )/n . Let λ = .
22h(U )/n +22h(V )/n
√ √
h(U + V ) = h( λX + 1 − λY )
≥ λh(X) + (1 − λ)h(Y )
n n
= λ h(U ) − log λ + (1 − λ) h(Y ) − log λ
2 2
n
= log 22h(U )/n + 22h(V )/n .
2
17
We will be using results from optimal transport theory (but we will derive things from scratch). This is an adapta-
tion of Olivier Rioul’s proof (2016).
Let FX and FY be the cdfs of X and Y respectively. If X ∗ ∼ N (0, 1), then Φ(x∗ ) is uniform on [0, 1], and
−1 −1
FX (Φ(X ∗ )) is distributed as X. So let TX = FX ◦ Φ so that TX (X ∗ ) is distributed as X. Note that TX is an
0
increasing function. [We assumed the densities are nonvanishing so the CDFs are strictly increasing.] Thus TX > 0.
Define TY similarly.
d
Let X ∗ , Y ∗ ∼ N (0, 1) be i.i.d. Then (TX (X ∗ ), TY (Y ∗ )) = (X, Y ) in distribution.
e Ye ∼ N (0, 1) be i.i.d. Then we can write
Let X,
√ √
X ∗ = λX e − 1 − λYe
√ √
Y ∗ = 1 − λX e + λYe
fye(e x))Θ0ye(e
x) = f (Θye(e x)
is a density.
√ √ 1
h( λX + 1 − λY ) = E log √ √
f ( λX + 1 − λY )
1
= E log
f (Θ e (X))
Y
e
Θ0ye(e
x)
= E log
fYe (e
x)
0 e
The last step is due to the change of variables φ(e
x) = fX (TX (e
x))TX (X),
0 e
0 e TX (X) 1 1
h(X)
e + E log TX (X) = E log = E log = E log = h(X).
φ(X)
e fX (TX (e
x )) f X (X)
18
√
To relax the condition that the densities of X and Y are non-vanishing, we use an approximation h(X + Z) →
h(X) as → 0.
We proved the entropy power inequality in dimension 1. In higher dimensions it takes a similar form in that the
constants do not degrade; it is dimension free.
Proof.
2 n−1 2 n−1
2h(X n−1 + Y n−1 | Xn + Yn ) ≥ (n − 1) log 2 n−1 h(X |Xn ) + 2 n−1 h(Y |Yn )
2h(Xn + Yn ) ≥ log 22h(Xn ) + 22h(Yn )
2 2 n 2 n
h(X n + Y n ) ≥ log 2 n h(X ) + 2 n h(Y ) concavity of log-sum-exp
n
Consider a adversarial channel who sees the distribution of X, chooses distribution Z and outputs Y = X + Z.
We want to find the capacity
sup inf I(X; X + Z)
PX PZ
subject to EX 2 ≤ σX
2
and EZ 2 ≤ σZ
2
.
19
Thus, we have the Gaussian channel saddle point property:
2
1 σX
log 1 + 2 = sup inf I(X; X + Z) = inf sup I(X; X + Z)
2 σZ PX PZ PZ PX
In other words,
I(X; X + Z ∗ ) ≤ I(X; X + Z) ≤ I(X ∗ ; X ∗ + Z).
So non-Gaussian channels have higher capacity.
Getting Gaussian codes to work for any channel: perform unitary transformation before sending to channel, and
then perform inverse on output. CLT?
A rate distortion pair (R, D) is achievable if there exists a sequence of (2nR , n) codes (fn , gn ) such that
Note that if (R, D) is achievable, then (R, D0 ) and (R0 , D) are also achievable if D0 ≥ D and R0 ≥ R.
The achievable rate distortion region is also convex: if you have two codes, you can flip a coin to choose which
code to use for a particular block. The rate and distortion will just be the convex combinations.
The point where the boundary of the achievable region hits the D = 0 axis is (H(X), 0). Where the boundary
hits R = 0 is (0, minxb Ed(X, x b)) (output the least offending guess on average). If dmax exists, it is larger than this
minimum.
Note that the achievability definition can be restated > 0 such that P (d(X n , gn (fn (X n )) > D + ) → 0 for all
> 0. (???)
The rate distortion function is R(D) = inf{R : (R, D) achievable}, the lower boundary of the achievable rate
distortion region.
Theorem 9.1. For Xi ∼ PX i.i.d., |X |, |Xb| < ∞, and distortion bounded by dmax ,
20
In channel coding, the channel is fixed and we control the distribution over the input. In this setting, the input PX
is given, and we control the encoding/decoding scheme that gives the output.
Recall PX|X
b 7→ I(X; X)b is convex for fixed PX , so this is a convex optimization problem. [Note that the
b = P p(x)p(b
constraint on the expected distortion is a linear constraint: Ed(X, X) x | x)d(x, xb).]
x,b
x
In channel coding, if we did not choose too many inputs, their typical images under the channel would hopefully
be disjoint. This is a packing argument. We could use a volume argument to estimate how many inputs we can send.
In our setting, we have some subset of Xbn of size 2nR , and we consider the “preimage” of inputs in X n that are
within distortion D of these outputs X(i).
b We want enough in the output space so that their “preimages” cover X n .
This is in some sense a dual of channel coding. Note that R controls the number of “preimages,” and with lower R, it
becomes harder to cover. D controls the size of each “preimage” and lower D makes it harder to cover.
Example 9.2. Let X ∼ Ber(p) with p ≤ 1/2. Let ⊕ be the XOR operation, and consider the Hamming distortion.
Lower bounding I(X, X) b ≤ D gives
b subject to Ed(X, X)
b = H(X) − H(X | X)
I(X; X) b
≥ H(p) − H(X ⊕ X
b | X)
b
≥ H(p) − H(X ⊕ X)
b
≥ H(p) − H(D).
H(p) − H(D) is the mutual information corresponding to the BSC with transition probability D taking some input
e and having output distribution Y following (p, 1 − p). Indeed, I(X; Y ) = H(Y ) − H(Y | X) = H(p) − H(D).
X
How do we use this information to achieve this rate in our original problem?
Put X b through a BSC(D) channel so that X has distribution (p, 1 − p). Using Bayes’s Rule gives P (b
x = 0) =
1−p−D
1−2D .
So, (
H(p) − H(D) D ≤ p
R(D) =
0 D>p
If D ≥ p, we can simply output 0 all the time, and then the expected distortion is p.
Example 9.3. Consider a Gaussian randomqvariable X ∼ N (0, σ 2 ). How would we do a one-bit quantization? Let
2 π−2 2
b1[X ≥ 0] − x
f (X) := x b1[X < 0]. If x
b= π σ, then E(X − f (X))2 = π σ ≈ 0.36σ 2 .
We want to find R(D) = minP c b 2 ≤D
:E(X−X) I(X; X).
b
X|X
b = h(X) − h(X | X)
I(X; X) b
= h(X) − h(X − X
b | X)
b
≥ h(X) − h(X − X)
b
1 1
≥ log(2πeσ 2 ) − log(2πeD)
2 2
1 σ2
= log .
2 D
We have shown a lower bound. Is equality attained?
Recall the theorem about the Gaussian channel: if Y = X + Z where X ∼ N (0, P ) and Z ∼ N (0, N ), then
I(X; Y ) = 21 log NN +P
.
Consider a Gaussian channel X = X b + Z where X b ∼ N (0, σ 2 − D) and Z ∼ N (0, D), then X ∼ N (0, σ 2 ).
2 2
Then I(X; X)b = 1 log σ . So, R(D) = 1 log σ .
2 D 2 D
Now compare with our one-bit quantizer. With the same second fidelity constraint D = 0.36σ 2 , the optimal rate
is R(0.36σ 2 ) = 12 log 0.36
1
≈ 0.737. This is a significant improvement over the rate 1 of the one-bit quantizer. It is
suboptimal to quantize on a symbol-by-symbol basis; we gain by quantizing on blocks.
21
Suppose X ∼ N (0, 1) is the input to a neural network which outputs X. b 2 = 1/2.
b Suppose we have E(X − X)
The information flow through any layer is ≥ R(1/2) = 1/2.
We now prove the theorem.
Proof of achievability. Fix PX|X
b
b ≤ D. We want to show that there exists a sequence of (2nR , n)
such that Ed(X, X)
b and achieve E[d(X n , gn (fn (X n ))) → D as n → ∞.
codes that have rate R ≈ I(X; X)
We define a distortion-typical set.
(n)
n 1
bn ) : − log p( xn , x
Ad, := (xn , x bn ) − H(X, X)
b < ,
n
1
− log p(xn ) − h(X) < ,
n
1
− log p(b xn ) − h(X)
b < ,
n
o
|d(xn , x
bn ) − Ed(X, X)|
b <
= A(n) n
bn ) : |d(xn , x
(X, X) ∩ {(x , x
b bn ) − Ed(X, X)|
b < }
⊆ A(n)
(X, X).
b
()
1. We have P (Ad,n ) → 1 since the two sets in the intersection have probability tending to 1, both by the weak law
of large numbers.
(n)
2. p(b xn | xn )2−n(I(X;X)+3) for all (xn , x
xn ) ≥ p(b bn ) ∈ Ad, .
b
xn , xn )
p(b
xn | xn ) = p(b
p(b xn ) xn )2−n(H(X,X)−H(X)−H(X)+3) = p(b
≥ p(b xn )2n(I(X;X)+3)
b b b
p(xn )p(bxn )
3. If 0 ≤ x, y ≤ 1 and n ≥ 0, then (1 − xy)n ≤ 1 − x + e−yn . To see this, note x 7→ (1 − xy)n is convex and
nonincreasing for fixed y. Also, x 7→ 1 − x + e−yn is linear and nonincreasing for fixed y. Also, 1 − y ≤ e−y .
[See Lemma 10.5.3.]
We describe the random code.
1. Generate 2nR sequences X
b n (i), i = 1, . . . , 2nR i.i.d. from P b .
X
Then,
Ed(X n , X
b n (i)) ≤ (1 − Pe )(D + ) + Pe dmax b) < ∞
dmax can be relaxed to min Ed(X, x
x
b
≤ D + + Pe dmax .
(n)
X
P ((xn , X
b n) ∈
/ Ad, ) = 1 − xn )1A(n) (xn , x
p(b bn )
d,
bn
x
" #2nR
(n)
X
P (@i : (xn , X
b n (i)) ∈ Ad, ) = 1− xn )1A(n) (xn , x
p(b bn ) independence
d,
bn
x
22
" #2nR
X X
Pe = p(xn ) 1 − xn )1A(n) (xn , x
p(b bn )
d,
xn bn
x
" #2nR
X X
n n n −n(I(X;X)+3) n n
≤ p(x ) 1 − x | x )2
p(b 1A(n) (x , x
b )
b
d,
xn bn
x
2nR
X X
−n(I(X;X)+3)
= p(xn )1 − 2 p(b
x n
| x n
)1 n
(n) (x , x
n
)
b
Ad,
| {z } b
xn
y bn
x
| {z }
x
" #
−2−n(I(X;X)+) 2nR
X X
n n n n n
c
≤ p(x ) 1 − x | x )1A(n) (x , x
p(b b )+e inequality in “3” above
d,
xn bn
x
(n) n(R−(I(X;X)+3))
= P ((X n , X / Ad, ) + e−2
b n) ∈
c
Recall the rate distortion setup. We give X n (drawn i.i.d. from some PX ) to an encoder, who then sends nR bits
to a decoder, who then outputs X b n which hopefully has distortion Ed(X n , X
b n ) ≤ D.
We want to characterize R(D) = inf{R : (R, D) achievable}, the lowest possible rate at which it is possible to
obtain [asymptotically] expected distortion ≤ D.
It turns out that
R(D) = min I(X; X).
b
PX|X
c :Ed(X,X)≤D
b
Last time, we proved achievability: if R > R(D), then there exists a sequence of (2nR , n) codes with
limn→∞ Ed(X n , X
b n ) ≤ D.
Sketch:
1. Fix PX|X
b such that EPX PX|X b ≤ D.
d(X, X)
c
3. If R > R(D), then we have chosen enough X b n (i) so that the set of all corresponding distortion balls is so large
that the probability of error is small...
We now turn to proving the converse. First, we need the following lemma.
We proved convexity of the operational definition of R(D) last time by showing the set of achievable pairs (R, D) is
convex. However, this lemma asserts convexity of the thing that we have yet to prove is equal to R(D).
(0) (1)
Proof. Let PX|X
b achieve R(D0 ), and let PX|X
b achieve R(D1 ).
(λ) (0) (1)
Define PX|X
b = λPX|X
b + λPX|X
b .
Since P b 7→ I(X; X) is convex for fixed PX , we have
X|X
b
b ≤ λI (0) (X; X)
IP (λ) (X; X) b + λI (1) (X; X)
b = λR(D0 ) + λR(D1 ).
P P
X|X
c X|X
c X|X
c
EP (λ) d(X, X)
b = λE (0) d(X, X) b ≤ λD0 + λD1 .
b + λE (1) d(X, X)
P P
X|X
c X|X
c X|X
c
23
Thus
b ≥
IP (λ) (X; X) min I(X; X)
b = R(λD0 + λD1 ).
X|X
c PX|X
c :Ed(X,X)≤λD
b 0 +λD1
We now prove the converse. We want to prove that if R < R(D), then (R, D) is not achievable by any scheme.
Proof of the converse. Consider a (2nR , n) code with encoder fn and decoder gn that achieves Ed(X n , X
b n) = D
n n
b = gn (fn (X )). We want to show R ≥ R(D).
where X
nR ≥ H(Xb n)
b n; X n)
≥ I(X
= H(X n ) − H(X n | X
b n)
Xn
= (H(Xi ) − H(Xi | Xb n , X i−1 )
i=1
n
X
≥ H(Xi ) − H(Xi | X
bi ) conditioning reduces entropy
i=1
Xn
= I(Xi ; X
bi )
i=1
n
X
≥ R(Ed(Xi , X
bi )) def. of R(D)
i=1
n
!
1X
≥ nR Ed(Xi ; X
bi ) convexity, Jensen
n i=1
n
1X bi ) = Ed(X n ; X
b n) = D
= nR(D). E d(Xi ; X
n i=1
Let us see what happens when the inequalities become tight, in order to characterize a good scheme.
bn ): all 2nR reproductions X(i)
• nR = H(X b are equally likely.
• H(X b n | X n ) = 0, i.e. X
b n is a deterministic function of X n . [This shows that randomized decoding doesn’t
help.]
b n , X1 , . . . , Xi−1 ) = H(Xi | X
• H(Xi | X bi ), i.e. X
bi is a sufficient statistic for Xi .
• In the application of Jensen, either R(D) is linear (usually isn’t), or, in the strictly convex case, Ed(Xi , X
bi ) = D
(exactly the same) for all i.
We now consider joint source channel coding. Let V m be the observation (i.i.d. from PV ). We encode V m and
encodes it into X n , which gets sent through a discrete memoryless channel (DMC) PY |X . The channel outputs Y n is
then decoded into a reproduction Vb m of the original observation. We would like Ed(V m , Vb m ) ≤ D.
n
Theorem 9.5. Distortion D is achievable if and only if R(D) ≤ BC where B = m is the bandwith mismatch.
24
This has a separation result, in that the following scheme is optimal. Do the rate-distortion optimal encoding to
nR(D) bits, and these are uniformly distributed. This what the channel likes. Use a channel code at rate C and send
it through the channel. Finally, do the corresponding channel decoding and the rate-distortion decoding.
The “if” part is simple: the rate R is lower than the capacity, so everything works.
For the reverse,
nC ≥ I(X n ; Y n ) channel coding converse
≥ I(V m ; Vb m )data processing
≥ mR(D). rate distortion converse
Thus R(D) ≤ BC.
where j(i) is the parent of i. Note that these approximations use the same P that we are estimating. So for each tree
we have an explicit approximation. We are not approximating P with any distribution with a tree structure.
We want to optimize
min D(P kPt )
t∈Tn
n−2
Note |Tn | = n .
Note D(P kPt ) ≥ ln22 kP − Pt k2T V .
A maximum weight dependence tree is a tree t satisfying
n
X n
X
I(Xi ; Xj(i) ) ≥ I(Xi ; Xj 0 (i) ), ∀t0 ∈ Tn .
i=1 i=1
In other words, if we consider the complete graph on n vertices with edge weights I(Xi , Xj ), then the maximum
weight spanning tree is this maximum weight dependence tree.
Theorem 10.1. t∗ ∈ argmint∈Tn D(P kPt ) if and only if it is a maximum-weight dependence tree.
Proof.
X P (x)
D(P kPt ) = P (x) log
x
Pt (x)
X X n
X
= P (x) log P (x) − P (x) log P (xi | xj(i) )
x x i=1
n n
X X P (xi , xj(i) ) X X
= −H(X) − P (x) log − P (x) log P (xi )
x i=1
P (xj(i) )P (xi ) x i=1
n
X n
X
= −H(X) + H(Xi ) − I(Xi ; Xj(i) ).
i=1 i=1
| {z }
no dependence on t
25
Pn
So argmint D(P kPt ) = argmaxt i=1 I(Xi ; Xj(i) ).
If we want to do this approximation, we just need to estimate the O(n2 ) mutual informations, rather than the O(2n )
probabilities (if xi are binary).
Maximum likelihood estimator of the true tree is the plug-in estimator. (Estimate mutual informations using data
and take the empirical maximum spanning tree.)
Why relative entropy ends up being nice? Chain rule / factorization is one possibility.
Our problem is as follows. We have X (1) , . . . , X (m) and we want to get an estimate of the dependence tree. We
estimate the mutual informations I(Xi , Xj ) and find the empirical max weight tree.
Recall I(X; Y ) = H(X) + H(Y ) − H(X, Y ). So it suffices to estimate entropies.
How do we estimate H(P ) given n i.i.d. samples drawn from P ?
Classical statistics. Suppose |X | = S is fixed. Find the optimal estimator of H(P ) as n → ∞. Let Pn denote the
empirical distribution, then X
H(Pn ) = − pbi log pbi
i
Rnmax (H b n )2 ,
b n ) = sup EP (H(P ) − H
P ∈MS
S2 (log S)2
Rnmax (H(Pn )) +
n2
|{z} n }
| {z
bias squared variance
If n S (e.g. n → ∞ while S fixed) then the bias term is small and we get the classical asymptotics. Otherwise,
bias term becomes important. So, consistency of MLE is equivalent to n = Θ(S).
Next time, we show we can do better.
Recall we are trying to estimate H(P ) for some distribution P , using i.i.d. samples X n . The MLE is H(Pn )
where Pn is the empirical distribution.
From classical statistics,
Var(− log P (X))
EP (H(P ) − H(Pn ))2 ∼
n
as n → ∞. If S is the support size, this suggests the sample complexity is Θ((ln S)2 ). However, this is only valid in
the asymptotic regime n → ∞ while support size is fixed.
26
If the support as size S,
S2 (ln S)2
sup EP (H(P ) − H(Pn ))2 2
+ .
P ∈MS n n
So the sample complexity of MLE is actually Θ(S). If n is not large enough, the bias term (first term) is too large.
There is a phase transition: if sample complexity is & S then the risk is nearly zero, if it is less, than the risk is
high.
Can we do better than the MLE? Valiant and Valiant showed that the [minimax?] phase transition for entropy
estimation occurs instead at Θ(S/ ln S).
We get an “effective sample size enlargement phenomena.” This result implies that the risk with n samples has the
same error as the MLE estimator with n log n samples.
P P
Note that entropy is separable: H(P ) = − i pi log pi = i f (pi ) where f (x) = −x log x.
Recall the issue with the MLE is large P bias when n is not large enough.
The plug-in estimator is H(Pn ) = − pbi log pbi . Consider the function f (x) = −x log x. If pbi ≈ pi and pi is
near 1/2, then f (b pi ) ≈ f (pi ) because the slope of f is low. However, near zero, f has infinite slope, so f (b
pi ) and
f (pi ) differ greatly.
To fix this, we divide [0, 1] into a smooth regime (log n/n, 1] and a non-smooth regime [0, log n/n).
1 00
For the smooth regime we have a bias-corrected estimate f (b pi ) − 2n f (b pi (1 − pbi ).
pi )b
For the non-smooth regime [0, log n/n), use the best (sup norm) polynomial approximation of f order log n.
Note that this estimation procedure does not depend on S.
We compare the L2 rates:
S2 (ln S)2
minimax : 2
+
(n log n) n
2 2
S (ln S)
MLE : 2 +
n n
Lemma 11.1.
R(D) = min min D(QX,Xb kPX RXb ).
Q∈A RX
c
Proof.
27
To implement the alternating minimization algorithm, we need to solve two problems.
• Given QX,Xb , find RXb that minimizes D(QX,Xb kPX RXb ). The above lemma implies RXb = QXb .
• Given RXb , find QX,Xb ∈ A that minimizes D(QX,Xb kPX RXb ). Since the marginal QXb is fixed, we just need to
find QX|X
b . The following lemma shows there is a closed form expression.
X
J(QX|X
b ) = D(QX|X
b PX kRXb PX ) + λ1 EQ d(X, X)
b + λ2 PX (x)QX|X
b x | x)
(b
x,b
x
∂ QX|X
b x | x)
(b
J(QX|X ) = PX (x) log + PX (x) + λ1 PX (x)d(x, x
b) + λ2 PX (x)
∂QX|X x | x)
(b RXb (b
x)
b
b
C = max I(X; Y )
PX
For any RX ,
RX (x)PY |X (y | x)
Q∗X|Y (x | y) := P 0 0
.
x0 RX (x )PY |X (y | x )
28
12 Information theory and statistics
12.1 Theory of types
Let X1 , . . . , Xn be a sequence of symbols from X = {ai }.
The type of X n , denoted PX n , is the empirical distribution associated to X n = (X1 , . . . , Xn ).
Pn denotes the set of types with denominator n, i.e., the possible types associated with a sample of size n.
Example 12.1. If X = {0, 1},
k n−k
Pn := , :0≤k≤n
n n
Theorem 12.3.
|Pn | ≤ (n + 1)|X | .
It makes sense that the probability depends only on the type. (Permuting does not affect the empirical distribution.)
Recall Qn (X n ) ≈ 2−nH(Q) for typical X n and contrast this with the statement of the theorem.
Proof.
P
1
P PX n (a)
−n PX n (a) log + PX n (a) log
2−n(H(PX n )+D(PX n kQ)) = 2 a∈X PX n (a) a∈X Q(a)
P
= 2n a∈X PX n (a) log Q(a)
Y
= Q(a)nPX n (a)
a∈X
= Qn (X n ),
where we note nPX n (a) is the number of times a appears in the sample.
Theorem 12.5.
1
2nH(P ) ≤ |T (P )| ≤ 2nH(P ) .
(n + 1)|X |
That is, the type class of P has about 2nH(P ) sequences.
This is a more precise notion than typical sets. Both shows how entropy is some notion of volume.
29
Proof.
1 ≥ P n (T (P ))
X
= P n (xn )
xn ∈T (P )
= |T (P )|2−nH(P ) .
P n (T (P )) ≥ P n (T (Pb)), ∀Pb ∈ Pn
and prove it later. Intuitively, it states that under a particular probability distribution, the type with maximum proba-
bility is the original distribution.
X
1= P n (T (Q))
Q∈Pn
X
≤ max P n (T (Q))
Q
Q∈Pn
X
= P n (T (P ))
Q∈Pn
≤ |Pn |P n (T (P ))
≤ (n + 1)|X | P n (T (P ))
= (n + 1)|X | |T (P )|2−nH(P ) .
P n (T (P )) P (a)nP (n)
Q
|T (P )|
= · Qa
P n (T (Pb)) |T (Pb)| nPb(a)
a P (a)
n
nP (a1 ),...,nP (a|X | ) Y
= · P (a)n(P (a)−P (a))
b
n
nP
b(a1 ),...,nP
b(a|X | ) a
a
n!
Y
= nn(P (n)−P (a))
b
a
P
= nn a (P (a)−P (a))
b
= 1.
Theorem 12.6. For any P ∈ Pn and any distribution Q, the probability of type class T (P ) under Q is
1
2−nD(P kQ) ≤ Qn (T (P )) ≤ 2−nD(P kQ) .
(n + 1)|X |
30
The probability of observing some empirical distribution under Q is exponentially small in the relative entropy.
Proof.
X
Qn (T (P )) = Q( xn )
xn ∈T (P )
X
= 2−n(D(P kQ)+H(P ))
xn ∈T (P )
= |T (P )|2−n(D(P kQ)+H(P )) .
P on P .
Note that the right-hand side does not depend
The Borel-Cantelli theorem implies that if n P(D(PX n kP ) > ) < ∞, then D(PX n kP ) → 0 almost surely.
≤ (n + 1)|X | 2−n
|X | log(n+1)
= 2−n(− n )
This is a law of large numbers: the probability of getting a sample whose empirical distribution is far from Q in relative
entropy is exponentially small. Applying Borel-Cantelli implies
31
12.2 Large deviations
Let X1 , X2 , . . . ∼ Q be i.i.d. on a finite alphabet X .
The weak law of large numbers states
n
!
1X
P Xi > EX1 + → 0.
n i=1
where n is called the large deviation. What is interesting is that E is an exponent that we can compute explicitly,
and the upper bound is tight up to a constant.
Pn
Example 12.8. Let Xi ∼ Ber(p) and Q = Ber(p). Note that n1 i=1 Xi = EX∼PX n X = PX n (1) (the proportion
of 1s under the empirical distribution).
n
!
1X X
P Xi ≥ p + = Qn (T (P ))
n i=1
P ∈Pn :P (1)≥p+
|Pn | −n min D(P kQ) −n min D(P kQ)
∈ 2 , |Pn |2
(n + 1)X
n
!
1X ·
P Xi ≥ p + = 2−n min D(P kQ)
n i=1
This example is a special case of the following theorem, with E being the collection of distributions on {0, 1} with
expectation ≥ p + .
Theorem 12.9 (Sanov’s theorem). Let X1 , X2 , . . . ∼ Q be i.i.d. and let E be a collection of probability distributions
on X . Then the probability that the empirical distribution PX n lies in E is
∗
Qn (E) = Qn (E ∩ Pn ) ≤ (n + 1)|X | 2−nD(P kQ)
,
where P ∗ := argminP ∈E D(P kQ). Moreover, if E is the closure of its interior, then
1
log Qn (E) → −D(P ∗ kQ),
n
that is, the lower bound matches the upper bound.
P
Common example of the collection E is E := P : x∈X g(x)P (x) ≥ α , that is, the set of distributions whose
such that EX∼P g(X) ≥ α. If g(x) = xk , this is a moment constraint. We could also have many constraints (gj and
αj for j = 1, . . . , J).
32
Proof.
X
Qn (E) = Qn (T (P ))
P ∈E∩Pn
X
≤ 2−nD(P kQ)
P ∈E∩Pn
X
Qn (E) = Qn (T (P ))
P ∈E∩Pn
n
≥ Q (T (Pn )) for any Pn ∈ E ∩ Pn
1
≥ 2−nD(Pn kQ) .
(n + 1)|X |
We need to find a sequence {Pn : Pn ∈ E ∩ Pn }n≥1 such that D(Pn kQ) → D(P ∗ kQ). If E has nonempty interior
and E is the closure of its interior, then we can approximate any interior point by a sequence of types, and this is
possible.
We review Sanov’s theorem. We consider the collection of probability distributions on X and observe
X1 , . . . , Xn ∼ Q for one particular distribution. Let E be a collection of other distributions, e.g., set of distribu-
tions with expected value ≥ 0.8. We want to understand the probability that the empirical distribution PX n is in E.
Sanov’s theorem implies that this probability exponentially small with exponent minP ∈E D(P kQ).
−nD(P ∗ kQ)
If P ∗ := argminP ∈E D(P kQ), then we get the lower bound Qn (T (P ∗ )) ≥ (n+1) 1
|X | 2 for free. The
“closure of the interior” condition allows use to use denseness of types to extend to the case where P ∗ is not a type.
Example 12.10. Suppose we have a fair coin. What is the probability of ≥ 700 heads in 1000 tosses? Let E =
{P : EX∼P X ≥ 0.7}. Why does this make sense? If the observations X n have ≥ 700 heads then PX n ∈ E (here
n = 1000). Note that Q is the fair distribution. Sanov’s theorem implies
1
log P(≥ 700 heads) ≈ −D((0.7, 0.3)k(0.5, 0.5)) ≈ 0.119
n
More precisely,
Again, n = 1000 (but the same argument works for any n). The upper and lower bounds differ only in an exponential
factor of log n/n; as n → ∞ these are very close.
To compute P ∗ = argminP ∈E D(P kQ) where E is convex, this becomes a convex optimization problem: use
Lagrange multipliers.
The more general version of Sanov’s theorem (continuous distributions, etc.) is as follows.
33
12.3 Conditional limit theorem
Suppose I am manufacturing bolts, each of which is supposed to nominally weight 10 grams. I find a batch of
1000 bolts that weighs ≥ 10.5 kilograms. What is the probability that any given bolt weights 11 grams?
[What does the bulk measurement tell us about the marginal distributions of the individual measurements?]
Theorem 12.12 (Conditional limit theorem). Suppose X1 , X2 , . . . ∼ Q are i.i.d. and we observe PX n ∈ E with
Q∈/ E and E is closed and convex.
p
P(X1 = a | PX n ∈ E) → P ∗ (a),
where P ∗ = argminP ∈E D(P kQ).
/ E, let P ∗
Theorem 12.13 (Pythagorean theorem). For E ⊂ P(X ) closed and convex, and Q ∈ :=
argminP ∈E D(P kQ). Then,
D(P kQ) ≥ D(P kP ∗ ) + D(P ∗ kQ)
for all P ∈ E.
Proof. For binary distributions, one can prove the following (exercise):
p p log e
p log + p log ≥ (2(p − q))2 .
q q 2
34
The data processing inequality for relative entropy: if P 0 = PY |X P and Q0 = PY |X Q, then
D(P kQ) ≥ D(P 0 kQ0 ).
Define a channel Y = 1{X∈A} . Then
D(P kQ) ≥ D((P (A), 1 − P (A))k(Q(A), 1 − Q(A)))
log e
≥ (2(P (A) − Q(A)))2
2
log e
= kP − Qk21 .
2
Intuition for the conditional limit theorem: P ∗ completely dominates the behavior of the marginal.
Proof of conditional limit theorem. Let St := {P ∈ P(X ) : D(P kQ) ≤ t}. This is a convex set.
Let D∗ := D(P ∗ kQ) = minP ∈E D(P kQ).
Let A := SD∗ +2δ ∩ E and B := E \ A = E \ SD∗ +2δ .
X
Qn (B) = Qn (T (P ))
P ∈E∩Pn :
D(P kQ)>D ∗ +2δ
X
≤ 2−nD(P kQ)
P ∈E∩Pn :
D(P kQ)>D ∗ +2δ
∗
≤ (n + 1)|X | 2−n(D +2δ)
.
Qn (A) ≥ Qn (SD∗ +δ ∩ E)
X
= Qn (T (P ))
P ∈E∩Pn :
D(P kQ)≤D ∗ +δ
1 ∗
≥ |X |
2−n(D +δ) .
(n + 1)
∗
Qn (B ∩ E) Qn (B) (n + 1)|X | 2−n(D +2δ)
P(PX n ∈ B | PX n ∈E ) = n
≤ n ≤ 1 −n(D ∗ +δ)
= (n + 1)2|X | 2−nδ → 0.
Q (E) Q (A) (n+1)|X |
2
[So, the probability that our empirical distribution is outside a KL-ball around P ∗ (given it lies in E) vanishes.] Thus,
P(PX n ∈ A | PX n ∈ E) → 1.
By the Pythagorean inequality, for P ∈ A we have
D(P kP ∗ ) + D∗ = D(P kP ∗ ) + D(P ∗ kQ) ≤ D(P kQ) ≤ D∗ + 2δ,
so D(P kP ∗ ) ≤ 2δ. This combined with Pinsker’s inequality implies
P(PX n ∈ A | PX n ∈ E) ≤ P(D(PX n kP ∗ ) ≤ 2δ | PX n ∈ E) ≤ P(kPX n − P ∗ k1 ≤ δ 0 | PX n ∈ E),
and by our earlier work, these three quantities tend to 1 as n → ∞. Consequently
P(|PX n (a) − P ∗ (a)| ≤ | PX n ∈ E) → 1.
Aside: after proving Sanov’s theorem, we proved D(PX n kP ) → 0 almost surely which implies kPX n − P k1 → 0
almost surely, by Pinsker’s inequality.
35
12.4 Fisher information and Cramer-Rao lower bound
Let f (x; θ) be a family of densities indexed by θ. For example, the location family is f (x; θ) = f (x − θ) for some
f.
An estimator for θ from a sample of size n is a function T : X n → Θ. The error of this estimator T (X n ) − θ is a
random variable. Pn
For example, Xi ∼ N (θ, 1) i.i.d. and T (X n ) = n1 i=1 Xi .
An estimator is unbiased if Eθ T (X n ) = θ.
The Cramer-Rao bound states that the variance of an unbiased estimator is lower bounded by 1/J(θ).
R 0 2
Example 12.15. Let f (x; θ) := f (x − θ). Then J(θ) = ff(x) (x) dx. This is a measure of curvature/smoothness. If f
is very spread out, it is hard to estimate θ; indeed then 1/J(θ) will be large.
Consider the initial condition u(0, x) = δ(x) (all heat starts at 0). Then a solution is
2
u0 (t, x) = (2πt)−n/2 e−|x| /2t
.
That is, at time t, the temperature profile is the Gaussian density with variance t.
R More generally, if the initial condition is u(0, x) = f (x), then a solution is the convolution u(t, x) =
f (s)u0 (t, x − s) ds where u0 is the Gaussian kernel above. Note that if we integrate over x, we get the “total
energy” which is conserved (constant in t). This is easy to see in the special case where f is a density (in x), in which
case the convolution will also be a density, which integrates (over x) to 1, which is constant in t.
√ us focus on this special case. Let X ∼ f and Z ∼ N (0, I). Then u(t, x) = ft (x) where ft is the density of
Let
X + tZ. [Convolution √ of densities is density of sum.]
We claim h(X + tZ) is nondecreasing in t. [This matches our intuition from the second law of thermodynamics.]
√ √
h(X + tZ) ≥ h(X + tZ | Z) = h(X).
This implies √ √ √ √
h(X + t + t0 Z) = h(X + tZ + t0 Z 0 ) ≥ h(X + tZ)
which implies our claim.
Amazingly, we not only know it is increasing in t, but we have a formula for the rate of increase.
d √ 1 √
h(X + tZ) = J(X + tZ).
dt 2
That is,
d 1
h(ft ) = J(ft ).
dt 2
36
We will define the Fisher information J now. Given a parametric family of densities {f (x; θ)} parameterized by
θ, the Fisher information at θ is 2
∂
J(θ) = E log f (X; θ) .
X∼f (x;θ) ∂θ
We will focus on location families where f (x; θ) := fX (x − θ) for some fixed density fX . In this case, the Fisher
information is
(f 0 (x))2
Z
J(θ) = dx,
f (x)
which is free of θ. We then use the compact notation J(θ) = J(f ) = J(X) to denote the Fisher information associated
with this density. This is the Fisher information that we will consider from now on.
In n dimensions, this generalizes to
|∇f (x)|2
Z Z p 2
J(f ) = J(X) = dx = 4 ∇ f (x) dx .
f (x)
√
The last expression shows how the Fisher information corresponds to the smoothness of f (actually, of f ).
We now prove de Bruijn’s identity.
Proof.
Z
d d
− h(ft ) = ft (x) log ft (x) dx
dt dt
Z Z
∂ ∂
= (log ft (x)) ft (x) dx + ft (x) dx
∂t ∂t
n
1 X ∂2
Z Z
d
= (log ft (x)) ft (x) dx + ft (x) dx
2 i=1 ∂x2i dt
| {z }
d
= dt 1=0
n Z
1 X ∂2
= (log ft (x)) ft (x) dx .
2 i=1
∂x2i
∂
Assuming (log ft (x)) ∂x i
ft (x) → 0 as |x| → ∞, integration by parts for each summand indexed by i (with respect
to dxi ) gives
n
∂2
Z
d 1X
− h(ft ) = (log ft (x))
ft (x) dx
dt 2 i=1 ∂x2i
2
n Z ∂
1 X ∂xi f t (x)
=− dx
2 i=1 ft (x)
|∇ft (x)|2
Z
1
=− dx
2 ft (x)
1
= − J(ft ).
2
Note that nonnegativity of Fisher information also shows that h(ft ) is nondecreasing in t.
We will use de Bruijn’s identity to prove an uncertainty principle for entropy and Fisher information.
The entropy power inequality gives
2
√ 2 2
√ 2
e n h(X+ tZ)
≥ e n h(X) + e n h( tZ)
= e n h(X) + 2πet
2
√ 2
e n h(X+ tZ)
− e n h(X)
≥ 2πe.
t
37
Taking t → 0 makes the left-hand side equal to
d 2 h(X+√tZ) 1 2
en = J(X)e n h(X) ,
dt t=0 n
by de Bruijn’s identity. Thus, we arrive at the following.
Proposition 13.2 (Stam’s inequality).
2
J(X)e n h(X) ≥ 2πen.
This is an uncertainty principle: product of two uncertanties is greater than some constant.
Note that in dimension n = 1, we have h(X) ≤ 12 log[2πe Var(X)], so we recover the Cramer-Rao bound
J(X) Var(X) ≥ 1.
de Bruijn 2 1
EPI =⇒ J(X)e n H(X) ≥ 2πen ⇐⇒ D(XkZ) ≤ I(XkZ)
2
We only showed the forward implication of the last “if and only if.” The reverse is simple too.
Note that the last result is dimension free.
Let g 2 := f /φ. We can reformulate the last result.
Z Z
2 |∇g|2 dγ ≥ g 2 log g 2 dγ .
This inequality still holds if we scale g by a constant. (Log terms will cancel.)
38
Theorem 13.4 (Log Sobolev inequality for Gaussian measure). For “smooth” g,
Z Z Z Z
2 |∇g| dγ ≥ g log g dγ − g dγ log g 2 dγ =: Entγ (g 2 ).
2 2 2 2
EPI =⇒ Fisher information-entropy uncertainty principle ⇐⇒ LSI (info. th.) ⇐⇒ LSI (functional form)
λ2
Z Z
2
2 2
|∇g| dγ = |∇F |2 eλF −λ /2 dγ
2
λ2
Z
2
≤ eλF −λ /2 dγ .
2
2
eλF −λ /2
R
Let Λ(λ) := dγ. The LSI implies
λ2 λ2
Z
2
eλF −λ /2
dγ =
Λ(λ)
2 2
Z
2
≥ eλF −λ /2 (λF − λ2 /2) dγ −Λ(λ) log Λ(λ)
Z
2
Λ(λ) log Λ(λ) ≥ eλF −λ /2 (λF − λ2 ) dγ = λΛ0 (λ).
1
We define the Herbst argument H(λ) = λ log Λ(λ). Then
39
13.4 Talagrand’s information-transportation inequality
The quadratic Wasserstein distance between two probability measures µ and ν (on the same space) is
W22 (µ, ν) = inf E|X − Y |2
PXY :PX =µ,PY =ν
We can think of this as a distance between measures, motivated by moving probability mass from one to the other. It
is actually a metric (satisfies triangle inequality, etc.). Also, it admits a nice dimension decomposition.
W22 (µ, ν) = inf E|X − Y |2
Xn
≥ E|Xi − Yi |2
i=1
n
X
= W22 (µi , νi ).
i=1
40
References
[1] Cover, Thomas and Thomas, Joy. Elements of information theory. John Wiley & Sons. 2012.
41