advanced37 min studyLesson 745 in Mathematics

Channel capacity and random coding

Derive finite-alphabet memoryless capacity as an asymptotic rate and understand how a random ensemble proves the existence of deterministic codes.

On this page

What you’ll understand

  • Define a finite DMC and rate in bits per channel use.
  • Explain the random-coding packing argument and its asymptotic error statement.
  • Distinguish average error, maximal error and uncoded symbol mistakes.

A noisy channel can corrupt individual symbols while still carrying a reliable message through a long codeword. Capacity identifies the largest asymptotic communication rate for which decoding error can vanish. It is not a promise that one use is error-free or that a short code attains a target error at that rate. Random coding supplies an existence argument: drawing many candidate codebooks reveals that at least one fixed codebook has the desired performance, even when a practical construction needs additional work.

Specify one channel and many independent uses

A discrete memoryless channel has finite input and output alphabets and a transition probability W(y given x). Conditional on the input block, its output law factors into a product of one-use transitions. A block code maps one of M equiprobable messages to n input symbols and reconstructs a message from the output. Its rate is log₂ M divided by n. Average error averages over messages, while maximal error takes the worst message's conditional probability.

For this finite stationary memoryless model without input cost constraints, capacity is the maximum mutual information over input distributions. The channel law stays fixed during this maximization; changing the input law changes the output law and their joint distribution. Compactness of the finite simplex and continuity guarantee a maximum. A rate below capacity is achievable with a sequence of block codes whose errors vanish as lengths grow. This does not attach an error value to an arbitrary finite codebook.

W⊗n(yn∣xn)=∏i=1nW(yi∣xi),Rn=log⁡2Mnn,C=max⁡PXI(X;Y)W^{\otimes n}(y^n\mid x^n)=\prod_{i=1}^nW(y_i\mid x_i),\qquad R_n=\frac{\log_2 M_n}{n},\qquad C=\max_{P_X}I(X;Y)
Rates and capacity are bits per use. The operational theorem concerns sequences of codes and vanishing error, not perfect transmission at a finite block length.↔ Scroll wide equations horizontally.

Packing separates a true word from competitors

Choose an input law and independently draw every codeword from its iid block distribution. A joint-typicality decoder looks for a unique codeword jointly typical with the received output. The actual transmitted pair is typical with high probability. An independently drawn competing word has roughly two to the minus n mutual-information chance of fitting the same output, with slack terms supplied by typicality. A union bound over the competing messages gives the essential rate condition.

If the rate lies strictly below that input law's mutual information, both the atypicality term and the competitor term can vanish. This bounds expected average error over the random ensemble. Therefore some deterministic codebook has no worse average error than the ensemble bound. The theorem does not require a new random codebook for each transmission, and it does not assert that every codebook drawn from the ensemble is good. An efficient encoder and decoder are further design questions.

R<I(X;Y)⟹∃ code sequence with P‾e,n→0,CBSC(e)=1−h2(e)R<I(X;Y)\quad\Longrightarrow\quad\exists\text{ code sequence with }\overline P_{e,n}\to0,\qquad C_{\mathrm{BSC}(e)}=1-h_2(e)
The binary symmetric channel has independent crossover probability e; the capacity formula is valid for 0≤e≤1, with a uniform input attaining it. The coding implication is asymptotic.↔ Scroll wide equations horizontally.

Expurgation and finite-block qualifications

If a deterministic code has small average error, at least half its messages have conditional error at most twice that average. Keeping those messages produces a code with controlled maximal error and loses at most one bit from log₂ M. The rate loss is at most one over n, so average-error and maximal-error capacities agree for this DMC. This expurgation argument concerns a carefully selected subcode, not an automatic improvement of every message in the original code.

Finite-block performance additionally depends on block length, desired error and code structure. Being below capacity establishes that sufficiently long good codes exist, without certifying a particular short code. Counting raw channel flips also differs from decoding error: an error-correcting decoder can recover a message despite several flipped symbols. Conversely, sending an uncoded long packet and requiring every symbol to arrive unchanged can have a declining success probability even while positive-rate reliable coding is possible.

A noisy binary channel still has positive capacity

For a binary symmetric channel with crossover probability 0.1, calculate capacity and assess the rates 0.4 and 0.7 bits per use.

  1. Given any input bit, output uncertainty is h₂(0.1)≈0.468996 bits. Output entropy cannot exceed one bit.

  2. A uniform input makes output fair and reaches that upper bound, so capacity is 1−h₂(0.1)≈0.531004 bits per use.

  3. Rate 0.4 is strictly below capacity and admits vanishing-error code sequences. Rate 0.7 is above capacity and cannot have vanishing error under the same model. These conclusions do not specify the error of a chosen length-100 code.

The result

Capacity is positive despite nonzero symbol noise. The operational distinction is asymptotic reliability at a specified rate.

Explore the model

Interactive lab

Interactive lab · probability

Count raw flips without confusing them with decoder failures

Pause and reset, then set both controls to p = 0.1 and n = 10. Interpret success as a raw flip; predict mean one, variance 0.9 and no-flip probability 0.9¹⁰≈0.348678. For a fresh comparison, pause and reset, then set p = 0.1 and n = 20; predict mean two, variance 1.8 and no-flip probability about 0.121577. The instrument does not implement a code or decoder. A smaller chance of zero raw flips does not imply that properly coded message reliability deteriorates.

Count raw flips without confusing them with decoder failuresThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA channel's symbol errors and a code's message-decoding errors are different random events.

Check your understanding

What does the random-coding average-error bound establish?

Try it yourself

A binary erasure channel erases each transmitted bit independently with probability 0.3 and otherwise reveals it exactly. Find its capacity under a fair input and justify why no other input improves it. Assess rates 0.65 and 0.8 bits per use.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Given an erasure, the fair bit retains one bit of uncertainty; otherwise its conditional uncertainty is zero. For a nonuniform input, scale its entropy by the reveal probability.

Compare with the solution

For any input law, the erasure indicator is independent of the input and reveals the symbol with probability 0.7. Thus I(X;Y)=0.7H(X), at most 0.7 bits, with equality for fair input. Capacity is therefore 0.7. Rate 0.65 admits vanishing-error code sequences, while rate 0.8 does not. This conclusion assumes a memoryless erasure process and the stated decoder observation; it does not treat an erasure as an unobserved bit flip or predict a particular finite code's error.

Take it with you

  • Finite DMC capacity maximizes mutual information over input laws with the channel fixed.
  • Random coding proves existence of good fixed codebooks below capacity.
  • Error criterion, block length and coding must be specified before interpreting reliability.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.