Information Theory

Introduction

Information theory, introduced by Claude Shannon (1948 1948), provides a quantitative framework for measuring information, uncertainty, compression limits, and communication reliability.

Its central idea: information corresponds to reduction in uncertainty. Rare events carry more information than predictable ones. This intuition is formalized through entropy and related measures.

Entropy

For a discrete random variable X X with pmf p⁡(x) p of x,H⁡(X)=−∑(p⁡(x))⁢log2⁡p⁡(x)=E⁢[−log2⁡p⁡(X)] H of X equals negative the sum of p of x the log base 2 of p of x equals E times open bracket negative the log base 2 of p of X close bracket.

Entropy is measured in bits (base-2 2 logarithm).

Basic Properties

  • H⁡(X)≥0 H of X is greater than or equal to 0, with equality iff X X is deterministic.

  • If X X takes n n values, then

H⁡(X)≤log2⁡n, H of X is less than or equal to the log base 2 of n comma with equality for the uniform distribution.

Binary Entropy

For X∼Bernoulli⁡(p) X tilde Bernoulli of p,

Hb⁡(p)=−p⁢log2⁡p−(1−p)⁢log2⁡(1−p) H sub b of p equals negative p the log base 2 of p minus open paren 1 minus p close paren times the log base 2 of open paren 1 minus p close paren.

Maximum uncertainty occurs at p=0.5 p equals 0.5, giving Hb⁡(0.5)=1 H sub b of 0.5 equals 1 bit.

Joint and Conditional Entropy

For joint distribution p⁡(x,y) p of open paren x comma y close paren: H⁡(X,Y)=−∑(p⁡(x,y))⁢log2⁡p⁡(x,y) H of open paren X comma Y close paren equals negative the sum of open paren p of open paren x comma y close paren close paren the log base 2 of p of open paren x comma y close paren.

Conditional entropy: H⁡(Y|X)=−∑(p⁡(x,y))⁢log2⁡(p)⁢(y|x) H of open paren Y divides X close paren equals negative the sum of open paren p of open paren x comma y close paren close paren the log base 2 of p times open paren y divides x close paren.

Chain rule: H⁡(X,Y)=H⁡(X)+H⁢(Y|X) H of open paren X comma Y close paren equals H of X plus H times open paren Y divides X close paren.

Mutual Information

Mutual information measures shared information: I⁡(X;Y)=H⁡(X)−H⁡(X|Y)=H⁡(X)+H⁡(Y)−H⁡(X,Y) I of open paren X semicolon Y close paren equals H of X minus H of open paren X divides Y close paren equals H of X plus H of Y minus H of open paren X comma Y close paren.

Equivalent KL form: I⁡(X;Y)=∑(p⁡(x,y))⁢log2⁡p⁡(x,y)p⁡(x)⁢p⁡(y) I of open paren X semicolon Y close paren equals the sum of open paren p of open paren x comma y close paren close paren the log base 2 of the fraction with numerator p of open paren x comma y close paren and denominator p of x p of y.

Properties

  • I⁢(X;Y)≥0 I times open paren X semicolon Y close paren is greater than or equal to 0 (equality iff independence).

  • Symmetric: I⁢(X;Y)=I⁢(Y;X) I times open paren X semicolon Y close paren equals I times open paren Y semicolon X close paren.

  • I⁢(X;X)=H⁡(X) I times open paren X semicolon X close paren equals H of X.

Kullback–Leibler Divergence

DK⁢L⁢(p∥q)=∑(p⁡(x))⁢log2⁡p⁡(x)q⁡(x) D sub K L times open paren p parallel to q close paren equals the sum of p of x the log base 2 of p of x over q of x .

  • DK⁢L≥0 D sub K L is greater than or equal to 0.

  • Zero iff p=q p equals q.

  • Not symmetric.

KL divergence measures distributional discrepancy and underlies many learning objectives.

Source Coding

Shannon’s source coding theorem:

Average code length ≥H⁡(X) is greater than or equal to H of X. There exist codes achieving average length arbitrarily close to H⁡(X) H of X.

Entropy is the fundamental limit of lossless compression.

Channel Capacity

For channel p⁢(y|x) p times open paren y divides x close paren, C=max⁡(I)⁢(X;Y) C equals max of I times open paren X semicolon Y close paren.

Shannon’s channel coding theorem:

  • Reliable transmission possible if R<C R is less than C.

  • Impossible if R>C R is greater than C.

Binary Symmetric Channel

With crossover probability p p:

C=1−Hb⁡(p) C equals 1 minus H sub b of p.

Differential Entropy

For density f⁡(x) f of x:

h⁡(X)=−∫f⁡(x)⁢log⁡(f⁡(x))⁢dx h of X equals negative the integral of f of x log f of x d x.

Unlike discrete entropy, it:

  • Can be negative.

  • Depends on coordinate scaling.

However, continuous mutual information remains non-negative.

Gaussian 𝒩⁢(μ,σ2) script N times open paren mu comma sigma squared close paren:

h=12⁢log2⁡2⁢π⁢e⁢σ2 h equals one half the log base 2 of 2 pi e sigma squared.

Maximizes entropy among fixed-variance distributions.

Data Processing Inequality

If X→Y→Z X right arrow Y right arrow Z (Markov chain),

I⁢(X;Z)≤I⁢(X;Y) I times open paren X semicolon Z close paren is less than or equal to I times open paren X semicolon Y close paren.

Processing cannot increase information.

Cross-Entropy

H⁡(p,q)=−∑(p⁡(x))⁢log⁡q⁡(x)=H⁡(p)+DK⁢L⁢(p∥q) H of open paren p comma q close paren equals negative the sum of p of x log q of x equals H of p plus D sub K L times open paren p parallel to q close paren.

Widely used as a loss function in classification.

Applications

  • Compression: Huffman, arithmetic coding.

  • Error correction: Codes approaching capacity.

  • Machine learning: Cross-entropy loss, mutual information, variational inference.

  • Statistics: Maximum entropy principle, likelihood, Bayesian updates.

Summary

Entropy quantifies uncertainty. Mutual information quantifies dependence. KL divergence measures distributional mismatch.

Shannon’s theorems establish fundamental limits for compression and communication. These principles govern modern communication systems, statistical inference, and machine learning.