+ All Categories
Home > Documents > Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas...

Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas...

Date post: 19-May-2021
Category:
Upload: others
View: 6 times
Download: 0 times
Share this document with a friend
25
Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel * [email protected] I made these notes while taking APMA 1710 at Brown during Fall 2016 (taught by Prof. Govind Menon 1 ), which followed the 2nd edition of the Cover & Thomas Information Theory Textbook [1]. If you find typos, please let me know at the email above. The images are of course based on the textbook, but are of my own creation. Contents 1 Chapter Two: Entropy 3 1.1 Definitions .......................................... 3 1.2 Identities .......................................... 3 1.3 Convexity .......................................... 4 2 Chapter Three: AEP 5 2.1 Definitions .......................................... 5 2.2 AEP ............................................. 5 2.3 Typical Set ......................................... 5 2.4 Codes ............................................ 7 2.5 Probable Set ........................................ 8 3 Chapter Four: Entropy Rates, Stochastic Processes 9 3.1 Definitions .......................................... 9 3.2 Entropy Rates ....................................... 9 3.3 Thermodynamics ...................................... 10 3.4 Main Theorems ....................................... 10 4 Chapter Five: Data Compression 12 4.1 Types of Codes ....................................... 12 4.2 Minimizing Length ..................................... 12 4.3 Huffman Codes ....................................... 14 4.4 Dyadic distributions .................................... 15 * http://david-abel.github.io 1 http://www.dam.brown.edu/people/menon/ APMA 1710 Page 1 David Abel
Transcript
Page 1: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

Information Theory Notes

Cover & Thomas Chapters 2-5, 7-9

David Abel∗

[email protected]

I made these notes while taking APMA 1710 at Brown during Fall 2016 (taught by Prof. GovindMenon1), which followed the 2nd edition of the Cover & Thomas Information Theory Textbook [1].If you find typos, please let me know at the email above. The images are of course based on thetextbook, but are of my own creation.

Contents

1 Chapter Two: Entropy 31.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Convexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Chapter Three: AEP 52.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 AEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.3 Typical Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.4 Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.5 Probable Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 Chapter Four: Entropy Rates, Stochastic Processes 93.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 Entropy Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.3 Thermodynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.4 Main Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4 Chapter Five: Data Compression 124.1 Types of Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124.2 Minimizing Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124.3 Huffman Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.4 Dyadic distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

∗http://david-abel.github.io1http://www.dam.brown.edu/people/menon/

APMA 1710 Page 1 David Abel

Page 2: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

5 Chapter Seven: Channel Capacity 165.1 Example Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165.2 Symmetric Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165.3 Properties of Channel Capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175.4 Channel Coding Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.4.1 Error and Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175.4.2 Jointly Typical Sets and Joint AEP . . . . . . . . . . . . . . . . . . . . . . . 18

5.5 Hamming Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195.6 Source Channel Coding Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

6 Chapter Eight: Differential Entropy 216.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

6.1.1 Uniform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226.1.2 Gaussian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

6.2 Mutual Info of Multivariate Normal . . . . . . . . . . . . . . . . . . . . . . . . . . . 226.3 Multivariate Normal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236.4 Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236.5 AEP For Continuous R.Vs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236.6 Maximum Entropy Bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

7 Chapter Nine: Gaussian Channel 247.1 Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247.2 Band Limited Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247.3 Shannon-Nyquist Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

APMA 1710 Page 2 David Abel

Page 3: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

1 Chapter Two: Entropy

1.1 Definitions

Entropy: H(X) = −∑x∈X p(x) log p(x)

Joint Entropy: H(X,Y ) = −∑x∈X∑

y∈Y p(x, y) log p(x, y)

Conditional: H(X | Y ) = −∑x∈X∑

y∈Y p(x, y) log p(x | y)

Relative Entropy: D(p || q) =∑

x∈X p(x) log p(x)q(x)

Mutual Information: I(X;Y ) = D(p(x, y) || p(x)p(y)) =∑

x∈X∑

y∈Y p(x, y) log p(x,y)p(x)p(y)

Others: I(X;Y | Z), I(X1, . . . , Xn;Y | Z), H(X1, . . . , Xn | Z), H(X,Y | Z), D(p(y | x) || q(y | x))

H(X,Y | Z) = H(X | Z) +H(Y | X,Z)

I(X;Y | Z) = H(X | Z)−H(X | Y, Z)

Note: can get at these from a three-way venn diagram

1.2 Identities

H(X)

H(X | Y) H(Y | X)

H(Y)I(X;Y)

H(X,Y)

Bounds:

• 0 ≤ H(X) ≤U log |X |, where ≤U is with equality iff p(x) is the uniform distribution.

• 0 ≤ H(Y | X) ≤I H(Y ), where ≤I is with equality iff X and Y are independent.

• 0 ≤ H(X,Y ) ≤I H(X) +H(Y ), where ≤I is with equality iff X and Y are independent.

• I(X;X) = H(X)

• 0 ≤ I(X;Y ) ≤ H(X)

• D(p || q) ≥ 0, with equality only if p = q.

APMA 1710 Page 3 David Abel

Page 4: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

1.3 Convexity

Convexity: for λ ∈ [0, 1]:

f(λx1 + (1− λ)x2)1

≤ λf(x1) + (1− λ)f(x2)2

(1)

Where 1 specifies any point on the function between x1 and x2, and 2 specifies any point on theline connecting f(x1) and f(x2). A function is convex when it’s second derivative is non negative.

Jensen’s Inequality: for f a convex function:

f(E[X]) ≤ E[f(X)] (2)

Data Processing Inequality: Suppose X → Y → Z forms a Markov Chain. Then:

I(X;Y ) ≥ I(X;Z) (3)

APMA 1710 Page 4 David Abel

Page 5: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

2 Chapter Three: AEP

2.1 Definitions

Markov’s Inequality: deviation of a r.v. from some value

Pr(X ≥ a) ≤ E[X]

a(4)

Chebyshev’s Inequality: deviation of r.v. from its mean:

Pr(|X − µ| ≥ ε) ≤ V ar[X]

ε2(5)

Convergence in Probability: for a given sequence {Ai}∞i=1:

limn→∞

Pr(|Ai − L| > ε) = 0

,Ai →PrL

Weak Law of Large Numbers: if {Xi}ni=1 are iid random variables with mean µ and varianceσ2 <∞, then the sample mean approaches the true mean as you get more samples:

1

n

n∑i=1

Xi →Prµ = E[X] (6)

2.2 AEP

AEP: Consider a sequence {Xi}∞i=1 where each Xi is iid with pmf p(x) and entropy H(X). Thenthe sample entropy approaches the true entropy as you get more samples. Or:

− 1

nlog p(X1, . . . , Xn)→

PrH(X)

limn→∞

Pr

(∣∣∣∣− 1

nlog p(X1, . . . , Xn)−H(X)

∣∣∣∣ > ε

)= 0

2.3 Typical Set

Typical Set: contains all sequences with “sample entropy” ≈ H(X).

A(n)ε =

{xn ∈ X n :

1

2n(H(x)+ε)≤ p(xn) ≤ 1

2n(H(x)−ε)

}(7)

So the probability of the sequences is roughly the average probability sequence.

A few properties about A(n)ε :

(1) The first is that the “sample entropy” is close to the true entropy. That is, for each

xn ∈ A(n)ε :

H(X)− ε ≤ − 1

nlog p(xn) ≤ H(X) + ε (8)

APMA 1710 Page 5 David Abel

Page 6: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

(2) Sampling a sequence from X n has probability greater than 1− ε to be in the typical set:

Pr(xn ∈ A(n)

ε

)> 1− ε (9)

Which follows from the AEP, basically. That is, since the sample entropy converges toH(X) in probability, there must exist a nε such that:

limn→∞

Pr(| − 1

nεlog p(xn)−H(X)| > ε

1

) < δ (10)

But note that the actual event, term 1 , can be rewritten into xn ∈ A(n)ε :

−ε ≤ − 1

nεlog p(xn)−H(X) ≤ ε

H(X)− ε ≤ − 1

nεlog p(xn) ≤ ε+H(X)

−nε(H(X)− ε) ≥ log p(xn) ≥ −nε(ε+H(X))

2−nε(H(X)−ε) ≥ p(xn) ≥ 2−n(ε+H(X))

Which is exactly the condition for being in the typical set. Therefore, for nε, Equation 10

occurs, which implies that xn ∈ A(n)ε . Therefore, the probability of being in the typical set

goes to 1 for n sufficiently large.

(3,4) The last two properties give bounds on the size of the typical set:

(1− ε)2n(H(X)−ε) ≤ A(n)ε ≤ 2n(H(X)+ε) (11)

Where the left hand size (lower bound) is for n sufficiently large.

We know the total number of length n sequences is |X n|, but surely the typical set doesn’t

contain every length n sequence. Since we know that each xn ∈ A(n)ε has bounds on the

probability of that sequence. We can leverage this to bound the size of A(n)ε :∑

xn∈Xn

p(xn) = 1

≥∑

xn∈A(n)ε

p(xn)

≥∑

xn∈A(n)ε

2−n(H(X)+ε)

APMA 1710 Page 6 David Abel

Page 7: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

But this last term doesn’t depend on xn, so:

≥∑

xn∈A(n)ε

2−n(H(X)+ε) = |A(n)ε | · 2−n(H(X)+ε) (12)

From the first equality, we see:

|A(n)ε | · 2−n(H(X)+ε) ≤ 1

∴|A(n)

ε |2n(H(X)+ε)

≤ 1

∴ |A(n)ε | ≤ 2n(H(X)+ε) �

Recall that P (xn ∈ A(n)ε ) > 1− ε for n large. We bound the LHS by:

P (xn ∈ A(n)ε ) ≤M

∑xn∈A(n)

ε

p(xn) =∑

xn∈A(n)ε

2−n(H(X)−ε) = |A(n)ε 2−n(H(X)−ε) (13)

Where ≤M follows since the right hand side gives the maximal probability of the set, sinceevery element is maximally probable.

2.4 Codes

Code: Assigns a unique binary sequence to every sequence in X n.

Need:

• n(H(X) + ε) + 2 bits to make a code for each item in the typical set.

• n log |X |+ 1 bits to make a code for each item not in the typical set.

Since there are |A(n)ε | ≤ 2−n(H(X)+ε), if we just enumerate all items in the typical set, we need

n(H(X) + ε) bits to code each item. We then add 1 in case that’s not an integer (could take ceiljust easily), and add 1 so we prefix all typical sequences with a 0. Therefore we have a code thatencodes all sequences in the typical set with n(H(X) + ε) + 2 bits. We get the same for the nontypical sets, giving us a total code length of n log |X |+ 1 (don’t need +2 since guaranteed integer).

If n is sufficiently large so that Pr(xn ∈ A(n)ε ) > 1 − ε, the expected length of a code word in the

typical set is:

E[

1

n`(Xn)

]≤ H(X) + ε (14)

On average, each element of the sequence takes about the entropy of the r.v. to encode. Thus wecan represent sequences Xn using around nH(X) bits on average.

APMA 1710 Page 7 David Abel

Page 8: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

E[`(Xn)] =∑xn

p(xn)`(xn)

=

∑xn 6∈A(n)

ε

p(xn)(n(H(X) + ε) + 2)

+

∑xn 6∈A(n)

ε

p(xn)(n log |X |+ 1)

= Pr(xn ∈ Aε(n))(n(H(X) + ε) + 2) + Pr(xn 6∈ A(n)

ε )(n log |X |+ 1)

≤ (n(H(X) + ε) + 2) + (n log |X |+ 1)

2.5 Probable Set

Probable Set: what is the relationship between the typical set and the smallest such set that

contains most the probability? Let B(b)δ be the smallest set such that:

Pr(xn ∈ B(b)δ ) ≥ 1− δ (15)

Then we’ll see that, for δ < 12 and δ′ > 0:

1

nlog∣∣∣B(n)

δ

∣∣∣ > H(X)− δ′ (16)

Thus, B(n)δ must have at least 2nH(x) elements, which is about the same size as A

(n)ε .

APMA 1710 Page 8 David Abel

Page 9: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

3 Chapter Four: Entropy Rates, Stochastic Processes

3.1 Definitions

Stochastic Process: S is an indexed sequence of random variables, {Xk}∞k=1

Stationary: A process S is stationary if the statistics don’t change as you move in time:

Pr(Xk+1 = x1, . . . , Xk+m = xm) = Pr(X1 = x1, . . . , Xm = xm) (17)

For all choices of m, k, and x.

Markov Process: S is a Markov Process (or Markov Chain) if:

Pr(Xk+1 = xk+1 | X1, . . . , Xk) = Pr(Xk+1 = xk+1 | Xk) (18)

Time Invariance: property of a Markov Chain if P (Xn | Xn−1) = P (X2 | X1).

Markov Chain can be characterized by a transition matrix, P :

P =

P1,1 P2,1 . . . Pn,1...

. . ....

P1,n P1,n . . . P1,n

(19)

And a start state. Typically we’ll ask for a start distribution. If the distribution after one transitionis identical to the start distribution, then we say it’s the stationary distribution:[

µ1, µ2, . . . , µn]

=[µ1, µ2, . . . , µn

]P (20)

We solve for the stationary distribution using Eigenvalue decomposition with eigenvalue one, orjust solving the system of equations.

That is, to solve for eigen values, we do Av = λv, so det(A−λI)v = 0, which gives the characteristicpolynomial. Solve for the roots gives eigen vectors.

With the stationary distribution, we see µ = µP , so µ is already known to be an eigenvector witheigenvalue 1. Thus, we just solve det(P − λI)µ = 0, for λ = 1.

3.2 Entropy Rates

Q: How does the entropy of a sequence X1, . . . , Xn grow with n?

Entropy Rate: The per symbol entropy of the n random variables, when the limit exists:

H(S) = limn→∞

1

nH(X1, . . . , Xn) (21)

And a related quantity, the conditional entropy rate of the last random variable given the sequence:

H ′(S) = limn→∞

H(Xn | Xn−1, . . . , X1) (22)

APMA 1710 Page 9 David Abel

Page 10: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

For a stationary stochastic process, H(S) = H ′(S), and the limit exists. H ′(S) existing follows byconditioning reducing entropy and non-negativity of entropy, so the probability has to pile up. Thesecond one, H(S), follows by applying the chain rule, so we get a running average of conditionalentropies. By the Cesaro Mean, a running average of things that converge to B also converges toB. Thus, H(S) converges to H ′(S), so they’re equal and the limit exists.

Entropy Rates. We have two definitions, H(S) and H ′(S). Moreover, they’re equivalent whichis convenient for computing the entropy rate of a stationary Markov chain.

If S is a stationary Markov chain, then H(S) is:

H(S) = H ′(S) = limn→∞

H(Xn | Xn−1, . . . , X1)

=M limn→∞

H(Xn | Xn−1)

=T limn→∞

H(X2 | X1)

= H(X2 | X1)

Where =M follows from the Markov property and =T follows by time invariance.

So the entropy rate of a stationary Markov chain is H(X2 | X1). Let µ be the stationary distributionand P be the transition matrix. Then:

H(X2 | X1) = −∑x1∈X

∑x2∈X

p(x1, x2) log p(x2 | x1) (23)

Where by the chain rule of probability, p(x1, x2) = p(x2 | x1)p(x1). Note that the transition matrixP denotes the probability of going to state x2 given state x1, and µ denotes the probability of beingin state x1. So:

H(X2 | X1) = −∑µi

∑Pij

µiPij logPij (24)

3.3 Thermodynamics

Relative entropy between two distributions decreases with time:

D(µn || µ′n) ≥ D(µn+1 || µ′n+1) (25)

Argument follows from chain rule for entropy (or expanding and using total law of prob).

From this we also see that the relative entropy between any distribution and the stationary distri-bution decreases with time. Let µ′n = κ be stationary, then µ′n+1 = µ′n, so, applying the previousresult:

D(µn || κ) ≥ D(µn+1 || κ) (26)

3.4 Main Theorems

• Theorem 4.2.1: stationary stochastic process, limits of H and H ′ exist and are equal in thelimit.

APMA 1710 Page 10 David Abel

Page 11: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

• 4.2.2: H(Xn | Xn−1 . . . X1) is non-increasing in n and has limit H ′.

• Cesaro Means

• Entropy Rate of Stationary Markov Chains

• Formula for the previous one

• Random Walks

APMA 1710 Page 11 David Abel

Page 12: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

4 Chapter Five: Data Compression

Definitions:

• A Source Code for a r.v. is a mapping from X to D∗, the set of finite-length strings froma size D alphabet. C(x) is the codeword of x and `(x) is the length of C(x).

• A code word’s expected length is: L(C) =∑

x∈X p(x)`(x)

4.1 Types of Codes

Three different types of source codes:

1. Nonsingular: every element of the alphabet of X maps to a different codeword:

x 6= x′ → C(x) 6= C(x′) (27)

2. Uniquely Decodable: Every sequence of coded strings decodes to exactly one message.

3. Instantaneous/Prefix: Can read each character as you read the code.

Where Prefix ⊂ Uniquely Decodable ⊂ Nonsingular ⊂ Codes:

Al

All codes

Nonsingular codes

Uniquely decodable codes

Instantaneous codes

4.2 Minimizing Length

So what we really want are prefix/instantaneous codes (they have the nicest properties). Thus, ourwhole goal with source codes is to come up with the prefix coding scheme that yields the shortestpossible expected length. Clearly we can’t make every single codeword super short and still be aprefix code. The Kraft Inequality gives us a fundamental limitation on the length of codewords:

Theorem (Kraft Inequality): Assume C is a prefix code. Then:∑x∈X

D−`(x) ≤ 1 (28)

APMA 1710 Page 12 David Abel

Page 13: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

Theorem (Converse Kraft Inequality): Given a set of lengths `(x) that satisfy:∑x∈X

D−`(x) ≤ 1 (29)

There exists a prefix code with these lengths.

Proof.

We can think of a prefix code as a binary tree, where each branch represents choosing oneof the D symbols for the next symbol of the code. Then a prefix code guarantees that eachcodeword has no children in the tree.

Consider the length of the longest codeword `max. Now consider all codewords at this levelof the tree.

In the complete tree (so no children are pruned, they’re just listed as a “descendent”), wehave: ∑

D`max−`i ≤ D`max (30)

Converse Proof

Proof.

Given lengths, `1 . . . , `k that satisfy the Kraft inequality, we can always come up with aprefix tree.

We care about finding the prefix code with minimum expected length: that is, due to Kraft, wewant to find a prefix code that satisfies the kraft inequality, that minimizes the expected code wordlength. So:

min`

(L) = min`

(∑i

pi`i

)(31)

Over all integers `1 . . . satisfying: ∑i

D−`i ≤ 1 (32)

We solve this using Lagrange Multipliers:

minλJ = min

λ

(∑pi`i + λ

(∑D−`i

))(33)

Where we differentiate w.r.t. `i, to get:

∂J

∂`i= pi − λD−`i logeD (34)

APMA 1710 Page 13 David Abel

Page 14: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

We set this equal to 0 to get:

D−`i =pi

λ logeD(35)

Now, we revisit our constraint from the Kraft Inequality:∑D−`i = 1

∴∑ pi

λ logeD=

1

λ logeD= 1

∴λ =1

logeD

So we conclude that pi = D−`i .

Thus, the optimal code lengths are `i = logD1pi

. Later we’ll force this to an integer with theceiling operator.

Theorem: Expected length L of any instantaneous D-ary code for a r.v. X is lower boundedbelow by the entropy HD(X):

HD(X) ≤ L ≤ HD(X) + 1 (36)

Proof of lower bound idea: Write out the difference L−HD(X) and turn the result into a relativeentropy quantity plus a positive constant, by the information inequality we conclude L−HD(X) ≥ 0.

Proof of upper bound idea: Let each length `i = dlogD1pie, so it’s guaranteed to be between logD

1pi

and logD1pi

+ 1. Then we multiplty both sides by pi and sum over i to get the bounds.

So the entropy is the central limitation on Data Compression.

4.3 Huffman Codes

Definition 1 (Huffman Code): The Huffman code is an algorithm for computing an optimalprefix code:

Input: a pmf, p, and an alphabet, A.Output: a code.

There are two steps:

(1) Cluster

(2) Rerank

The cluster step takes a probability vector of m elements in order of mass: 〈p1, p2, . . . , pm〉 andcomputes an length m − 1 vector, also in order, where the two smallest elements are merged:〈p1, p2, . . . , pm−1 + pm〉.

APMA 1710 Page 14 David Abel

Page 15: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

• Procedure for making them

• Examples

• They’re optimal

4.4 Dyadic distributions

Generating distributions from fair coins, properties.

APMA 1710 Page 15 David Abel

Page 16: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

5 Chapter Seven: Channel Capacity

Summary: we find the maximum number of distinguishable signals for n uses of a communicationchannel.

Encoderp(y | x)

Channel DecoderMessage

W Xn Yn W

Estimate of Message

Definition 2 (Channel Capacity): We define the information channel capacity of a discretememoryless channel (DMC) as:

maxp(x)

I(X;Y ) (37)

Intuition: if we could control exactly how bits are sent, what’s the most info we can send over thechannel? How much shared info is there between the output and the input.

5.1 Example Channels

• Noiseless binary channel, Noisy channel with nonoverlapping outputs, Noise typewriter

• Binary Symmetric Channel with crossover probability p:

I(X;Y ) = H(Y )−H(Y | X) = H(Y )−H(p) ≤ 1−H(p) (38)

• Binary Erasure Channel with erasure probability α:

I(X;Y ) = 1− α (39)

5.2 Symmetric Channels

Definition 3 (Symmetric Channel): A channel is said to be Symmetric if the rows of thechannel transition matrix p(y | x) are permutations of each other and the columns are permu-tations of each other.

Definition 4 (Weakly Symmetric Channel): A channel is said to be Weakly Symmetric ifif every row of the transition matrix p(· | x) is a permutation of every other row and the sums∑

x p(y | x) are all equal.

APMA 1710 Page 16 David Abel

Page 17: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

Theorem: For a weakly symmetric channel:

C = log |Y| −H(row of transition matrix) (40)

Which is achieved by a uniform distribution on the inputs.

5.3 Properties of Channel Capacity

1. C ≥ 0 since I(X;Y ) ≥ 0

2. C ≤ min {log |X |, log |Y|}, C ≤ min {H(X), H(Y )}.

3. I(X;Y ) is a continuous function of p(x) and is concave.

5.4 Channel Coding Theorem

Definition 5 ((M,n) Code): An (M,n) code for the channel (X , p(y | x),Y) consists of thefollowing:

1. An index set {1, . . . ,M}.

2. An encoding function Xn : {1, . . . ,M} 7−→ X n, resulting in codewords xn(1), xn(2), . . ..The set of codewords is called the code book.

3. A decoding function g : Yn 7−→ {1, . . . ,M}.

5.4.1 Error and Rate

We have a several definitions relevant to error.

1. First: λi, which is the probability of error in sending message i over the channel:

λi = Pr(g(Y n) 6= i | Xn(i) = xn(i)) =∑yn

p(yn | xn)1{yn 6= g(xn)} (41)

2. The maximal probability of error is just the maximal error term over all λi:

λ(n) = maxiλi (42)

3. The average probability of error P(n)e for an (M,n) code is:

P (n)e =

1

M

∑i

λi (43)

APMA 1710 Page 17 David Abel

Page 18: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

Definition 6 (Rate): The rate, denoted R, of an (M,n) code is:

R =logM

nbits per transmission (44)

So the rate is, per bit sent over the channel, how much of the actual message does it actually capture?

A rate is achievable if there exists a sequence of(d2nRe, n

)codes such that the maximal probability

of error goes to zero as n goes to infinity.

5.4.2 Jointly Typical Sets and Joint AEP

Definition 7 (Jointly Typical Set): The jointly typical set for two r.v.’s is:

A(n)ε , {(xn, yn) : fε(x

n, yn)} (45)

Where:

fε(xn, yn) = − 1

nlog p(©)−H(©) < ε (46)

Where © can be xn, or can be yn, or both at the same time (xn, yn). Where:

p(xn, yn) =

n∏i=1

p(xi, yi) (47)

That is, it must satisfy all three conditions.

Joint AEP gives us the same properties as the AEP:

1. Pr((Xn, Y n)) ∈ A(n)ε → 1 as n→∞

2. |A(n)ε | ≤ 2n(H(X,Y )+ε)

3. Consider (Xn, Y n) ∼ p(xn)p(yn): that is, the tilde vars are sampled independently but withthe same marginals as Xn and Y n. Then:

(1− ε)2−n(I(X;Y )+3ε) ≤ Pr((Xn, Y n) ∈ A(n)ε ) ≤ 2−n(I(X;Y )−3ε) (48)

Takeaway from 3. is that, the probability that the independently sampled var-pairs are in thetypical set is controlled by the mutual information.

Channel Coding Intuition: All rates below capacity C are achievable, and all rates above capacityare not.

APMA 1710 Page 18 David Abel

Page 19: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

Theorem (Channel Coding Theorem): For a discrete memoryless channel, all rates below ca-pacity C are achievable. Specifically, for every rate R < C, there exists a sequence of (2nR, n)codes with maximum probability of error λ(n) → 0.

Conversely, any sequence of (2nR, n) codes with λ(n) → 0 must have R ≤ C.

Proof idea:

• Pick a random codebook.

• Send messages as usual over the channel: so we receive yn.

• Decode via joint typicality:

– Search the codebook for the pair (xn(i), yn) ∈ A(n)ε . That is, find the input message

that, when coded, probably led to the output.

– We assume this is the message sent. We might error due to two things:

1. We don’t find such a pair.

2. We find a pair but it’s the wrong one.

– Per the properties of the jointly typical set, both of these occur negligibly often.

5.5 Hamming Codes

The actual coding scheme used for the Channel Coding Theorem is highly impractical (it’s random!).Hamming codes solve that. Best description is from the Venn Diagram:

1

1

01

Place the 4 information bits into the 4 central intersecting regions. To code, place 1s in each ofthe remaining regions so that each circle has an even number of bits. Then when you receive themessage, reconstruct the venn diagrams and you can identify where bits may have been flipped.

Hamming code is the elements of the null space of the matrix denoting the possible messages.That is, each column is a possible message. We compute the null space of matrix h, which is theset of vectors such that Hv = 0.

Just solve: Hv = 0 and you’re done.

APMA 1710 Page 19 David Abel

Page 20: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

5.6 Source Channel Coding Theorem

Here we combine the two central results:

1. Data compression: R > H

2. Data Transmission: R < C

Theorem (Source Channel Coding Theorem) Let V = V1, V2, . . . , Vn be any stochastic processthat satisfies the AEP, and H(V) < C. Then there is a source-channel code with probabilityof error Pr(V n 6= V n)→ 0.

Conversely, for any stationary stochastic process, if H(V) > C, it’s not possible to send theprocess over the channel with arbitrarily low probability of error.

Takeaway: The separation theorem says that the separate encoder can achieve the same rates asthe joint encoder. That is, the following two are the same:

Source Encoder p(y | x)

Channel Channel DecoderMessage

Xn(Vn) Yn

Estimate of Message

VnV n

Channel Encoder

Source Decoder

Encoderp(y | x)

Channel DecoderMessage

Xn(Vn) Yn

Estimate of Message

Vn V n

Proof idea:

• Since the stochastic process satisfies the AEP, it implies there exists a typical set.

• Index all sequences in the typical set.

• There are at most 2n(H(X)+ε) elements in the typical set, so we need at most n(H(X) + ε)bits to encode them.

• If H(V) + ε = R < C, we can transmit the sequence with low probability of error:

Pr(V n 6= V n) ≤ Pr(V n 6∈ A(n)ε ) + Pr(g(Y n) 6= V n | V n ∈ A(n)

ε ) ≤ ε+ ε (49)

Converse combines Fano’s Inequality and the Data Processing Inequality.

Fano’s Inequality: For any estimator X such that X → Y → X, with Pe = Pr(X 6= X), we have:

H(Pe) + Pe log |X | ≥ H(X | X) ≥ H(X | Y ) (50)

Or:1 + Pe log |X | ≥ H(X | Y ) (51)

APMA 1710 Page 20 David Abel

Page 21: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

6 Chapter Eight: Differential Entropy

Suppose X is a r.v. taking values in R with pdf f(x), with support {x | f(x) > 0}. Then we getour usual definitions:

1. Differential Entropy: h(X) =∫S f(x) log f(x)dx.

2. Joint Entropy: h(X1, X2, . . . , Xn) = −∫f(xn) log f(xn)dxn.

3. Conditional Entropy: h(X | Y ) = −∫f(x, y) log f(x | y)dx dy.

4. KL-Divergence: D(f || g) =∫Sf∩Sg f(x) log f(x)

g(x)dx

5. Mutual Information: I(X;Y ) =∫f(x, y) log f(x,y)

f(x)f(y)dx dy

We can translate between Differential Entropy and Discrete Entropy. Consider quantizing f(x)according to some fixed step size, ∆. That is, approximate the curve with blocks of width ∆.

4

Let H(X∆) = −∑∞−∞ pi log pi. Where pi is going to be the value of those rectangles.

Consider a point xk. Then along the interval, [xk, xk+∆], let p(xk) =∫ xk+∆

xkf(x)dx, where

H(X∆) = −∑∞−∞ p(xk) log p(xk).

Idea: We’re taking rectangles and putting them over each interval so that the area of the rectangleis identical to the area of the curved piece of the function.

But p(xk) = pk = f(xk) ·∆, since it just describes a box that approximates the pdf for that interval(width ∆ and height f(xk)). So:

H(X∆) ≈ h(x)− log ∆ (52)

APMA 1710 Page 21 David Abel

Page 22: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

In more detail, we have that:

H(X∆) = −∞∑−∞

pi log pi

= −∞∑−∞

f(xi)∆ log (f(xi)∆)

= −∞∑−∞

f(xi)∆(log f(xi) + log ∆)

= −∞∑−∞

f(xi)∆ log f(xi)︸ ︷︷ ︸goes to h(f) as ∆→ 0

−∞∑−∞

f(xi)∆ log ∆︸ ︷︷ ︸=log ∆

Therefore, we add the right term to get H(X∆) + log ∆ = −∑∞−∞ f(xi)∆ log f(xi), which, as∆→ 0, becomes h(X).

6.1 Examples

Now, some example continuous channels.

6.1.1 Uniform

Let X be a r.v. with uniform probability on the interval [0, a]. Then:

h(X) = −∫ a

0f(x)logf(x)dx = −

∫ a

0

1

alog

1

adx = log a (53)

6.1.2 Gaussian

Let X be a r.v. with a Gaussian density function:

f(x) ∼ φ(x) =1√

2πσ2exp−−x

2

2σ2(54)

Then it’s entropy is:

h(X) = −∫ ∞−∞

φ lnφ =1

2ln 2πeσ2 (55)

6.2 Mutual Info of Multivariate Normal

Suppose K =

[σ2 ρσ2

ρσ2 σ2

]. Then:

I(X;Y ) = h(X) + h(Y )− h(X,Y ) (56)

And we can compute h(X) and h(Y ) via the entropy of a normal distribution: 12 log

[2πeσ2

], and

we can compute h(X,Y ) as the entropy of a multivariate normal: 12 log [2πedet(K)], and we’re

done.

APMA 1710 Page 22 David Abel

Page 23: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

6.3 Multivariate Normal

h(X1, . . . , Xn) = h(Nn(µ,K)) =1

2log [2πedet(K)] (57)

6.4 Identities

Key: In general, h(X) + n is the number of bits on the average required to describe X to n-bitaccuracy.

• Venn Diagram: I(X;Y ) = h(X)− h(Y | X) = h(Y )− h(X | Y ) = h(X) + h(Y )− h(X,Y )

• Information Inequality: D(f || g) ≥ 0. Consequently:

– I(X;Y ) ≥ 0, equality iff independent.

– h(X) ≥ h(X | Y ), equality iff independent.

– h(X1, . . . , Xn) ≤∑ni=1 h(Xi), equality iff independent.

• Hadamard’s Inequality:

det(K) ≤n∏i=1

Ki,i (58)

• h(X + c) = h(X)

• h(aX) = h(X) + log |a|

6.5 AEP For Continuous R.Vs

Let X1, . . . , Xn be a sequence of r.v.s drawn i.i.d. from density f(x). Then:

− 1

nlog f(X1, . . . , Xn)→ h(X) (59)

Typical set is the same, but the set-cardinality is translated into the Volume of the continuous set.

6.6 Maximum Entropy Bound

If a pdf has variance N , then the entropy of the pdf is upper bounded by:

h(f) ≤ h(N (0, N)) =1

2log [2πeN ] (60)

Proof idea:

• Consider the relative entropy of a pdf with variance/covariance K and a normal with vari-ance/covariance K: φK . This is: D(f ||φK).

• Expanding, we get:

0 ≤ D(f ||φK) =

∫f(x) log

f

φKdx =

∫f log f −

∫f log φK = −h(f) + h(φk) = h(φk)− h(f)

(61)And we know the last piece is ≥ 0, so we’re done.

APMA 1710 Page 23 David Abel

Page 24: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

7 Chapter Nine: Gaussian Channel

Xi is a r.v. with a continuous alphabet X , we have a time discrete channel with noise Yi = Xi+Zi,where the noise Zi ∼ N (0, N). The noise is assumed to be independent of the signal.

If there’s no constraint on the input, then the capacity could be infinite since X can take anyreal value, so we can just spread the input values arbitrarily far apart subject to whatever noiseis present in the channel. To avoid this (which is clearly unrealistic) we impose an input powerconstraint.

Power Constraint:1

n

n∑i=1

x2i ≤ P (62)

Capacity is the same, but now subject to a power constraint:

C = maxp(x):E[x]≤P

I(X;Y ) ≤ 1

2πe

(1 +

P

N

)(63)

Proof idea is just to write it out: The noise is just Z, so I(X;Y ) = h(Y )−h(Y | X) = h(Y )−h(Z),where h(Z) = 1

2 log [2πeN ]. Plug and chug.

Note that:

E[Y 2] = E[(X + Z)2] = E[X2 +XZ + Z2] = E[X2] + E[XZ] + E[Z2] (64)

We know E[Z] = 0,

7.1 Codes

We can make codes in the same way, only now the encoding function produces codewords suchthat:

∑ni=1 xi(w)2 ≤ nP .

A rate is achievable there exists a code that satisfies the power constraint and the usual notion ofachievability is obtained.

Channel Coding Theorem: We get the channel coding theorem again for Gaussian channels.That is, any Rate R < C is achievable, and the converse, that any rate R ≥ C is not achievable.

7.2 Band Limited Channels

Consider the frequency domain, with ω ranging from −∞ to∞, corresponding to different frequen-cies. Consider a continuous function of time f(t) that spits out different frequencies.

Definition 8 (Bandlimited): We say f(t) is bandlimited to W if F (ω) = 0 for |ω| > W .

So if there is some value for which, outside that interval, there are no frequencies!

APMA 1710 Page 24 David Abel

Page 25: Information Theory Notes Cover & Thomas Chapters 2-5, 7-9Information Theory Notes Cover & Thomas Chapters 2-5, 7-9 David Abel david_abel@brown.edu I made these notes while taking APMA

7.3 Shannon-Nyquist Theorem

Idea: if f is bandlimited to W (so it only has frequencies in the interval [−2πW, 2πW ]), from dis-crete samples we can reconstruct the full continuous function. That is, we can reconstruct the fullsignal from samples taken at every 1

2W seconds. So the full function f(t) is determined by f(n

2W

),

for n ∈ Z.

f(n/2W ) = 1/2π

∫ 2πW

−2πWF (ω) exp(iω

n

2W)dw (65)

References

[1] Thomas M Cover and Joy A Thomas. Elements of information theory. John Wiley & Sons,2012.

APMA 1710 Page 25 David Abel


Recommended