Information Theory: Entropy, Coding, and Channel Limits

Information theory is the mathematical study of how information is quantified, compressed, transmitted, and recovered across noisy channels. Introduced systematically by Claude Shannon in 1948, the discipline separates the semantic meaning of a message from its statistical uncertainty and physical representation. Whether a signal consists of spoken words, binary packets over fiber optics, compressed video frames, or neural spike trains, information theory establishes fundamental limits on what any encoder, decoder, or communication link can achieve.

In practical engineering, information theory answers two foundational questions: how compactly can a source of data be represented without losing fidelity, and how reliably can data be sent over an imperfect medium prone to noise, interference, or erasure?

Information Content and Shannon Entropy

At the heart of information theory is surprisal (or self-information). If an event xxx occurs with probability P(x)P(x)P(x), its information content—measured in bits when using base-2 logarithms—is:

I(x)=−log⁡2P(x).I(x) = -\log_2 P(x).I(x)=−log2​P(x).

A highly probable event carries little surprise and therefore little new information; a rare event carries greater surprise and more information.

Shannon entropy, denoted H(X)H(X)H(X), is the expected information content of a discrete random variable XXX with probability distribution p(x)p(x)p(x) over alphabet X\mathcal{X}X:

H(X)=−∑x∈Xp(x)log⁡2p(x).H(X) = -\sum_{x \in \mathcal{X}} p(x) \log_2 p(x).H(X)=−x∈X∑​p(x)log2​p(x).

Entropy measures uncertainty or average surprise per symbol. It reaches its maximum—log⁡2∣X∣\log_2 \vert{}\mathcal{X}\vert{}log2​∣X∣ bits—when all outcomes in a finite alphabet of size ∣X∣\vert{}\mathcal{X}\vert{}∣X∣ are equally likely (uniform distribution), and equals 000 when one outcome is certain (p(x)=1p(x) = 1p(x)=1 for some xxx).

Joint, Conditional, and Mutual Information

When analyzing multiple random variables (X,Y)(X, Y)(X,Y), several related quantities extend single-variable entropy:

  • Joint Entropy H(X,Y)H(X, Y)H(X,Y): Measures the total uncertainty of the pair (X,Y)(X, Y)(X,Y), satisfying H(X,Y)≤H(X)+H(Y)H(X, Y) \le H(X) + H(Y)H(X,Y)≤H(X)+H(Y) with equality if and only if XXX and YYY are independent.
  • Conditional Entropy H(Y∣X)H(Y \mid X)H(Y∣X): Measures the remaining uncertainty about YYY after observing XXX, defined as H(Y∣X)=∑x,yp(x,y)log⁡21p(y∣x)H(Y \mid X) = \sum_{x, y} p(x, y) \log_2 \frac{1}{p(y \mid x)}H(Y∣X)=∑x,y​p(x,y)log2​p(y∣x)1​. The chain rule states H(X,Y)=H(X)+H(Y∣X)H(X, Y) = H(X) + H(Y \mid X)H(X,Y)=H(X)+H(Y∣X).
  • Mutual Information I(X;Y)I(X; Y)I(X;Y): Measures how much knowing XXX reduces uncertainty about YYY (and vice versa):

I(X;Y)=H(Y)−H(Y∣X)=H(X)−H(X∣Y)=∑x,yp(x,y)log⁡2p(x,y)p(x)p(y).I(X; Y) = H(Y) – H(Y \mid X) = H(X) – H(X \mid Y) = \sum_{x, y} p(x, y) \log_2 \frac{p(x, y)}{p(x)p(y)}.I(X;Y)=H(Y)−H(Y∣X)=H(X)−H(X∣Y)=x,y∑​p(x,y)log2​p(x)p(y)p(x,y)​.

Mutual information is always non-negative (I(X;Y)≥0I(X; Y) \ge 0I(X;Y)≥0) and equals zero precisely when XXX and YYY are statistically independent.

Source Coding and Data Compression

Source coding deals with representing source symbols efficiently using as few bits as possible.

Lossless Compression and the Source Coding Theorem

In lossless compression, the original data must be reconstructed with zero error. Shannon’s source coding theorem proves that for an independent and identically distributed (i.i.d.) source with entropy H(X)H(X)H(X), no uniquely decodable code can achieve an average codeword length strictly less than H(X)H(X)H(X) bits per symbol, while optimal prefix-free codes (such as Huffman coding) or arithmetic/asymmetric numeral systems can approach H(X)H(X)H(X) closely.

Redundancy in natural language, images, or structured logs—arising from skewed symbol frequencies or correlations between adjacent symbols—creates room for compression. Removing statistical redundancy shrinks storage footprints and transmission bandwidth without altering the underlying message.

Lossy Compression and Rate-Distortion Theory

When exact reconstruction is unnecessary—such as in audio, image, and video delivery—lossy compression trades a controlled amount of distortion DDD for a lower bit rate RRR. Rate-distortion theory characterizes the minimum rate R(D)R(D)R(D) required so that expected distortion stays within a target bound DDD, guiding perceptual codecs and quantization schemes.

Channel Capacity and Error Correction

When data travels across a physical or logical channel, noise can flip bits, shift amplitudes, or drop packets. A discrete memoryless channel is specified by conditional transition probabilities p(y∣x)p(y \mid x)p(y∣x) mapping channel input xxx to channel output yyy.

Channel Capacity and the Noisy-Channel Coding Theorem

The channel capacity CCC of a communication channel is the maximum mutual information between input and output over all allowed input distributions p(x)p(x)p(x):

C=max⁡p(x)I(X;Y).C = \max_{p(x)} I(X; Y).C=p(x)max​I(X;Y).

For an additive white Gaussian noise (AWGN) channel with signal power PPP, noise power NNN, and bandwidth BBB, the Shannon-Hartley theorem gives capacity in bits per second:

C=Blog⁡2(1+PN).C = B \log_2 \left(1 + \frac{P}{N}\right).C=Blog2​(1+NP​).

Shannon’s noisy-channel coding theorem states that for any transmission rate R<CR < CR<C, there exist coding schemes with arbitrarily small error probability as block length increases. Conversely, transmitting at rates R>CR > CR>C prevents reliable communication with vanishing error. Capacity sets a speed limit on reliable data transfer; it does not eliminate noise by itself, but guarantees that structured redundancy can overcome noise up to CCC.

Error-Detecting and Error-Correcting Codes

To approach channel capacity in practice, systems add structured parity or redundancy through channel coding:

  • Block and Convolutional Codes: Map kkk-bit message blocks into nnn-bit codewords (n>kn > kn>k), enabling detection and correction of bit errors.
  • Modern Capacity-Approaching Codes: Turbo codes, low-density parity-check (LDPC) codes, and polar codes operate near Shannon limits across wireless links, storage drives, and deep-space communications.

Key Concepts at a Glance

ConceptCore QuestionKey Formula or BoundPrimary Role
Entropy H(X)How uncertain or surprising is a source?−∑p(x)log2​p(x)Bounds lossless compression limits
Mutual Info I(X;Y)How much do X and Y share?H(X)−H(X∣Y)Measures correlation & channel transfer
Capacity CWhat is the max reliable rate on a channel?maxp(x)​I(X;Y)Sets theoretical transmission ceiling
Rate-Distortion R(D)What is the min rate for distortion ≤D?Minimized mutual info under E[d]≤DGuides lossy compression trade-offs

Applications Across Computing and Science

Information theory reaches well beyond telecommunications:

  • Data Storage and Networking: File compression formats, protocol framing, packet retransmission/erasure coding, and SSD/RAID reliability rely on source and channel coding principles.
  • Machine Learning and Statistics: Cross-entropy loss, Kullback-Leibler (KL) divergence, maximum likelihood estimation, and information bottleneck formulations connect model training directly to relative entropy and mutual information.
  • Cryptography: Perfect secrecy (Shannon’s one-time pad condition requires key entropy at least as large as message entropy) and entropy estimation for random number generators depend on information-theoretic analysis.
  • Physics, Neuroscience, and Genetics: Researchers use entropy and mutual information to analyze thermodynamic microstates, sensory coding in neurons, and sequence conservation in biological data.