Channel Capacity
The information capacity of a discrete memoryless channel, worked examples, jointly typical sequences, Shannon's second theorem and its converse, Hamming codes, feedback, and source–channel separation
Motivation: what does it mean for A to communicate with B?
When we say that A communicates with B, we mean that the physical acts of A have induced a desired physical state in B. The operator’s keystroke must end up as the right letter on the receiver’s tape. This transfer is a physical process and is therefore subject to the uncontrollable ambient noise and imperfections of the signalling hardware itself. The communication is successful if the receiver and the transmitter agree on what was sent.
Everything we have built so far measured how much information a source produces. This chapter asks the dual question: given a fixed, noisy wire, how much can we push through it and still agree at the other end?
flowchart LR W["Message W"] --> E[Encoder] E --> Xn["X^n"] Xn --> CH["Channel p(y|x)"] CH --> Yn["Y^n"] Yn --> D[Decoder] D --> WH["W-hat: estimate of message"]
The core difficulty. Each possible input sequence induces a probability distribution on output sequences. Since two different input sequences may give rise to the same output sequence, the inputs are confusable — and a confused receiver cannot agree with the sender.
IntuitionThe plan in one sentence
We will show we can choose a “nonconfusable” subset of input sequences, so that with high probability there is only one highly likely input that could have caused any particular output. By mapping the source into appropriately “widely spaced” input sequences, we can transmit with very low probability of error. The maximum rate at which this can be done is the capacity.
In this chapter we find the maximum number of distinguishable signals for uses of a channel. This number grows exponentially with , and the exponent is the channel capacity. Characterizing that exponent as a maximum mutual information is the central and most famous success of information theory.
ImportantThe duality with compression
There is a duality between data compression and data transmission. During compression we remove all the redundancy in the data to reach the most compressed version possible; during transmission we add redundancy in a controlled fashion to combat channel errors. The at the end shows these two halves can be designed completely independently without losing anything.
The channel and its information capacity
DefinitionDiscrete channel
A discrete channel is a system consisting of an input alphabet , an output alphabet , and a probability transition matrix expressing the probability of observing output symbol given that we send symbol .
The channel is memoryless if the probability distribution of the output depends only on the input at that time and is conditionally independent of previous channel inputs or outputs.
IntuitionThe physical anchor
is exactly the noise profile of the copper wire we have been
carrying since [[entropy-mutual-information#Conditional entropy |conditional entropy]]:
“if E is keyed, what is the chance T prints?” Memorylessness says the wire
has no thermal hangover — a burst of static on pulse 5 does not make pulse 6
more likely to fail. This is an assumption about the physics, and real wires
with capacitance violate it.
DefinitionInformation channel capacity
The information channel capacity of a discrete memoryless channel is
where the maximum is taken over all possible input distributions .
| Component | Detail |
|---|---|
| Signature | — it is a functional of the channel, i.e. of the transition matrix. |
| Domain | The noise profile alone: the fixed physical property of the wire the telecom has installed. |
| What is maximized over | , the sender’s input distribution — the one thing an engineer controls. The wire is given; the language used on it is a design choice. |
| Codomain | A single non-negative real: the bits per channel use that this wire can carry. |
WarningTwo different meanings of the word “capacity”
The definition above is an optimization over distributions — pure mathematics, no codes in sight. Separately there is an operational capacity: the highest rate in bits per channel use at which information can actually be sent with arbitrarily low probability of error. These are a priori different quantities. Shannon’s second theorem establishes that they are equal, which is why we then drop the word “information” and just say capacity. Until is proved, keep them mentally separate.
IntuitionWhy maximize rather than just evaluate
depends on both the wire and the operator’s habits. A wire that could carry 1 bit per use carries almost nothing if the operator only ever presses one key ( for a deterministic source). The capacity asks what the wire is worth when driven optimally, so it is a property of the hardware rather than of whoever happens to be sitting at it.
Examples of channel capacity
Working the examples before the general theory is worthwhile: each one isolates a different reason a wire can or cannot carry information, and the last two are the workhorses of the entire field.
Noiseless binary channel
flowchart LR X0["0"] --> Y0["0"] X1["1"] --> Y1["1"]
Example bit
The binary input is reproduced exactly at the output. Any transmitted bit is received without error, so one error-free bit can be transmitted per channel use, and the capacity is 1 bit. The formula agrees: bit, achieved by .
Noisy channel with nonoverlapping outputs
flowchart LR X0["0"] -->|1/2| A["1"] X0 -->|1/2| B["2"] X1["1"] -->|1/3| C["3"] X1 -->|2/3| D["4"]
Example bit — the channel appears noisy but really is not
Each input has two possible outputs, so the output is a random consequence of the input. But the two output sets and are disjoint, so the input can be determined from the output and every transmitted bit is recovered without error. Capacity is again 1 bit, achieved by .
IntuitionRandomness is not the enemy — overlap is
This example is the cleanest possible separation of two ideas people conflate. The channel injects genuine randomness (), yet loses zero information, because the randomness never creates ambiguity about the input. What destroys information is not noise per se but confusability: two inputs that can produce the same output.
Noisy typewriter
Example bits
The input is either received unchanged with probability , or
transformed into the next letter with probability . With 26
input symbols, the outputs of A and B overlap (both can print B), so the
full alphabet is confusable.
The trick: use only every alternate input symbol — , 13 of them. Now no two used inputs can produce the same output, and we transmit one of 13 symbols with zero error per use. Hence bits per transmission.
Confirming with the formula, using that bit for every input (each input has two equally likely outputs):
achieved by uniform over all the inputs.
RemarkTwo different optima, one capacity
Note the mild paradox: the zero-error scheme uses 13 inputs, while the distribution achieving the information capacity is uniform over all 26. Both give . This channel is the mental picture to keep for the whole chapter — argues that for large block lengths every channel looks like the noisy typewriter, with a nonconfusable subset of inputs hiding inside a confusable alphabet.
Binary symmetric channel
flowchart LR X0["0"] -->|1 - p| Y0["0"] X0 -->|p| Y1["1"] X1["1"] -->|p| Y0 X1 -->|1 - p| Y1
The BSC complements the input symbol with probability . This is the simplest model of a channel with errors, yet it captures most of the complexity of the general problem.
WarningWhy the BSC is qualitatively harder than everything above
When an error occurs, a is received as a and vice versa — and the bits received do not reveal where the errors occurred. In a sense every received bit is unreliable. Unlike the noisy typewriter there is no nonconfusable subset to retreat to: every input can produce every output. That we can still send at a nonzero rate with arbitrarily small error is the counterintuitive content of Shannon’s theorem.
DerivationCapacity of the BSC
Step 1: Expand mutual information from the receiver’s side.
Step 2: The inner conditional entropy is the same for every input. Given , the output is with probability and with probability — a binary distribution with entropy , regardless of which was sent. This is the “symmetric” in binary symmetric channel:
Note is now a constant the input distribution cannot influence — the noise term is untouchable, so maximizing reduces to maximizing .
Step 3: Bound by the maximum entropy bound. is a binary random variable, so :
Step 4: Check achievability. Equality needs , i.e. uniform, which a uniform input distribution delivers (by symmetry of the channel).
FormulaBSC capacity
IntuitionReading the formula
You start with 1 bit per use and the wire taxes you exactly bits — the entropy of the coin flip that decides whether each bit is flipped. At , and : the output is independent of the input and the wire is dead. At the capacity is back to 1 bit, because a wire that always lies is as good as one that always tells the truth.
Binary erasure channel
flowchart LR X0["0"] -->|1 - alpha| Y0["0"] X0 -->|alpha| YE["e"] X1["1"] -->|alpha| YE X1 -->|1 - alpha| Y1["1"]
The analogue of the BSC in which bits are lost rather than corrupted: a fraction of the bits are erased, and crucially the receiver knows which bits have been erased. Two inputs, three outputs.
DerivationCapacity of the BEC
Step 1: Set up. As before, , and given any input the output is “that input” w.p. or “erasure” w.p. , so and
Step 2: Intuition check — the naive guess fails. The first guess for would be , since has three values. But no choice of input distribution achieves it: the erasure probability is imposed by the wire, so is fixed and cannot be tuned to . The maximum-entropy bound is not tight here, and we must compute honestly.
Step 3: Decompose using the erasure indicator. Let . Since is a function of , appending it is free: . Now chain-rule the other way:
Step 4: Evaluate both terms. Let . Then . For : given there is no uncertainty (, contributing 0); given the output equals the input, contributing , and this case has weight . So
Step 5: Maximize and cancel.
achieved at .
FormulaBEC capacity
IntuitionWhy this answer is the obvious one
A proportion of the bits are lost outright, so we can recover at most a proportion of them, and the capacity is at most . What is not immediately obvious is that this rate is achievable — that follows from Shannon’s second theorem.
ExampleFeedback makes the BEC trivial
If the receiver can talk back, it is very clear what to do: if a bit is lost, retransmit it until it gets through. Bits get through with probability , so the effective rate is — we hit capacity with a scheme a child could design.
Later we prove is the best achievable both with and without feedback. This previews the surprising result that feedback does not increase the capacity of a discrete memoryless channel: here it bought us enormous simplicity, not extra rate.
Symmetric channels
The problem. The examples above were each solved by an ad hoc argument. Is there a structural condition under which the capacity has a closed form? There is, and it generalizes exactly what made the BSC easy.
Consider the channel
where the entry in row , column is . All the rows are permutations of each other, and so are the columns.
DefinitionSymmetric and weakly symmetric channels
- A channel is symmetric if the rows of are permutations of each other and the columns are permutations of each other.
- A channel is weakly symmetric if every row is a permutation of every other row, and all the column sums are equal.
ExampleAnother symmetric channel
, where has some distribution on , has the same alphabet as , and is independent of . Every row is the distribution of , cyclically shifted.
ExampleWeakly symmetric but not symmetric
The two rows are permutations of each other and every column sums to , but the columns are not permutations of one another.
TheoremCapacity of a weakly symmetric channel
achieved by a uniform distribution on the input alphabet.
ProofThe two symmetry conditions do two separate jobs
Step 1: The rows being permutations kills the noise term’s dependence on . Letting denote a row of the transition matrix, every row has the same entropy , so
Step 2: Bound the remaining term. By the maximum entropy bound,
with equality iff the output distribution is uniform.
Step 3: The equal column sums make the uniform input produce a uniform output. Take . Then
where is the (common) column sum. So the bound in Step 2 is attained.
∎
IntuitionWhat each condition buys
Rows permutations the noise cost is a constant the sender cannot influence, so the problem collapses to maximizing . Equal column sums the easiest possible input (uniform) already maximizes . Weak symmetry keeps exactly these two properties and discards the rest, which is why the theorem is stated for it rather than for full symmetry.
ExampleThe channel above
achieved by a uniform input distribution.
RemarkConnection to the second law
The transition matrix of a symmetric channel is doubly stochastic — the same condition that, in the second law discussion, characterized exactly when the uniform distribution is stationary and entropy genuinely increases. Both places, it is the statement “this dynamics has no preferred direction among the symbols.”
Properties of channel capacity
| # | Property | Reason |
|---|---|---|
| 1 | Since (a [[information-inequalities#Consequences of Jensen’s inequality | |
| 2 | . | |
| 3 | Same reason, from the other side. | |
| 4 | is a continuous function of | — |
| 5 | is a concave function of | Follows from the concavity results built on the [[information-inequalities#The log sum inequality |
ImportantWhy concavity matters practically
is concave over a closed convex set (the simplex of input distributions), so a local maximum is a global maximum — no risk of an optimizer getting trapped. Properties 2 and 3 make the maximum finite, which justifies writing maximum rather than supremum in the definition. Together these mean the capacity can be found by standard nonlinear optimization: constrained maximization via Kuhn–Tucker conditions, the Frank–Wolfe gradient search, or the iterative Arimoto–Blahut algorithm.
WarningNo closed form in general
For a general channel there is no closed-form solution for the capacity. The channels for which we can write one down — the symmetric and weakly symmetric families above — are special, and we lean on them precisely because they are the tractable cases.
Preview of the channel coding theorem
Before the formal proof, here is why bits per use ought to be transmissible. The basic idea: for large block lengths, every channel looks like the noisy typewriter, with a subset of inputs producing essentially disjoint output sets.
IntuitionThe counting argument
Fix a typical input -sequence. The channel scatters it over approximately possible sequences, all roughly equally likely — this is the “blur” the wire applies to one codeword. Meanwhile the total number of typical sequences is about .
We want no two sequences to produce the same output, or we cannot decide which was sent. So we must pack disjoint blurs of size into a space of size , and the number of disjoint sets is at most
Hence we can send at most about distinguishable sequences of length .
NoteWhat this argument does and does not establish
This is a sphere-packing upper bound — it shows you cannot do better. A stronger version of the same idea is what the next sections turn into a proof that the rate is actually achievable with arbitrarily low error. Upper bound first, achievability after.
Definitions
Before the theorem we need the vocabulary precise. Everything here is bookkeeping, but the converse proof leans on the exact definitions.
DefinitionDiscrete channel (formal)
A discrete channel, denoted , consists of two finite sets and and a collection of pmfs , one for each , with and for every .
Definitionth extension of a DMC
The th extension is the channel where
RemarkWithout feedback, the extension factorizes
If the channel is used without feedback — i.e. the input symbols do not depend on past outputs, — the transition function reduces to a clean product:
“Discrete memoryless channel” means without feedback unless stated otherwise. The distinction matters: the proof fails at exactly the point where this factorization is used.
Definition code
An code for the channel consists of:
- An index set .
- An encoding function , yielding codewords . The set of codewords is the codebook.
- A decoding function , a deterministic rule assigning a guess to each possible received vector.
DefinitionThe three error probabilities
- Conditional probability of error given index was sent:
- Maximal probability of error:
- Arithmetic average probability of error:
NoteRelations between them, and a subtlety
If is chosen uniformly over and , then , and obviously .
is only a mathematical construct of the and is a genuine probability of error only when the message is uniform. Both the achievability and converse proofs choose a uniform to bound the error — this lets us establish the behaviour of too, and thereby characterize the channel regardless of how it is actually used.
One would expect the maximal and average probabilities to behave very differently, but we prove below that a small average error implies a small maximal error at essentially the same rate.
DefinitionRate, achievability, and operational capacity
- The rate of an code is bits per transmission.
- A rate is achievable if there exists a sequence of codes such that the maximal probability of error as .
- The capacity of a channel is the supremum of all achievable rates.
(We write for throughout.)
IntuitionWhat the definition of achievable is really demanding
Not “error is small for some ” but “error can be driven to zero while the rate is held fixed at .” Sending more slowly as grows is not allowed. Rates below capacity yield arbitrarily small error probability for sufficiently large block lengths.
Jointly typical sequences
The problem. The decoder must decide which codeword caused the received . Maximum likelihood is optimal but hard to analyze. Instead we will decode by asking whether a codeword and the output “look like they came from the joint distribution” — which requires a joint version of the typical set.
DefinitionJointly typical set
The set of jointly typical sequences with respect to is the set of -sequences with empirical entropies -close to the true entropies:
where .
IntuitionWhy all three conditions are needed
The first two say each sequence is individually typical — plausible as a tape from its own source. The third is the one that does the work: it says the pair is typical, i.e. the two tapes are typical of each other. Dropping it would let an arbitrary pairing of two perfectly ordinary tapes count as jointly typical, and the decoder would have no discriminating power at all.
TheoremJoint AEP
Let be sequences of length drawn i.i.d. according to . Then:
- as .
- .
- If — independent, with the same marginals — then and, for sufficiently large ,
ImportantProperty 3 is the whole proof of the coding theorem in one line
Read it as: a codeword unrelated to the received sequence looks jointly typical with it only with probability about . So we can afford about rival codewords before one of them fools us. Everything in is a union bound over that number.
ProofPart 1 — three applications of the weak law
Step 1: Each marginal concentrates. By the weak law of large numbers, in probability. So given there exists such that for all ,
Step 2: Repeat for and for the pair. Identically, and in probability, giving and with each failure probability below .
Step 3: Union bound. Choosing , the probability of the union of the three bad events is less than . Hence . This is why each budget was set to — so the three failures sum to exactly .
∎
ProofPart 2 — total probability bounds the count
Identical in shape to the size bound in the single-variable AEP:
since each jointly typical pair has probability at least . Rearranging gives .
∎
ProofPart 3 — count the pairs, then price each one under independence
Upper bound. If and are independent with the same marginals, then
There are at most terms (part 2), and each term is at most by joint typicality:
using and collecting the three ‘s — which is where the comes from.
Lower bound. For large, , so
giving . Feeding this count through the same product bound in the other direction:
∎
IntuitionThe picture
There are about typical sequences and about typical sequences — so possible pairings. But only pairs are jointly typical, so not all pairs of typical sequences are jointly typical. A randomly chosen pair is jointly typical with probability about , so you can consider about pairs before stumbling on one — suggesting about distinguishable signals.
Equivalently, from the decoder’s seat: for a fixed received there are about conditionally typical inputs, out of typical inputs overall, so a random rival codeword lands in that set with probability .
Channel coding theorem
ImportantWhy the result is counterintuitive
If the channel introduces errors, how can one correct them all? Any correction process is itself subject to error, ad infinitum. Shannon broke this apparent regress with three ideas:
- Allow an arbitrarily small but nonzero probability of error.
- Use the channel many times in succession, so the law of large numbers comes into effect.
- Average the probability of error over a random choice of codebooks, which symmetrizes the problem and shows the existence of at least one good code.
TheoremChannel coding theorem (Shannon’s second theorem)
For a discrete memoryless channel, all rates below capacity are achievable. Specifically, for every rate there exists a sequence of codes with maximum probability of error .
Conversely, any sequence of codes with must have .
NoteDecoding rule used in the proof
We decode by joint typicality: look for a codeword jointly typical with the received sequence, and if it is unique, declare it. This is suboptimal (maximum likelihood is optimal) but it is simple to analyze and still achieves all rates below capacity.
ProofAchievability — random coding, union bound, then three code surgeries
Setup: generate a random codebook. Fix . Generate codewords independently according to , and display them as the rows of a matrix
Every entry is i.i.d. , so .
The protocol.
- A random code is generated as above.
- is revealed to both sender and receiver, who also know .
- A message is chosen uniformly: .
- The th codeword is sent.
- The receiver receives .
- The receiver declares if is jointly typical and there is no other index with . If no such exists, or more than one does, an error is declared.
- Error event .
Step 1: Average over codebooks, and exploit symmetry. Rather than analyze one code, compute
By the symmetry of the code construction, does not depend on — every codeword was generated the same way. So we may assume without loss of generality that was sent:
This is the single biggest simplification in the proof, and it is bought entirely by randomizing the codebook.
Step 2: Name the two ways to fail. Define for . With sent, an error occurs if either:
- — the true codeword is not jointly typical with the output, or
- — some wrong codeword is.
By the union bound,
Step 3: Bound the first source of error. By joint AEP part 1, , so for sufficiently large.
Step 4: Bound each rival. By the code generation process, and are independent for ; hence so are and (since depends only on ). So joint AEP part 3 applies exactly: .
Step 5: Assemble.
if is sufficiently large and . Read the exponent: the number of rivals grows like and each is fooled with probability , so the product vanishes precisely when .
Step 6: Three surgeries to upgrade the conclusion.
- Optimize the input distribution. Choose , the distribution achieving capacity. Then the condition becomes .
- Remove the average over codebooks. Since the average error over codebooks is , at least one codebook has . (An exhaustive search over all codes would find it.) This is the classic probabilistic-existence move: we never construct a good code, we prove the average is good and conclude one must be.
- Convert average error into maximal error. The arithmetic average implies at least half the indices have — otherwise that half alone would contribute more than to the average. Throw away the worst half of the codewords. The survivors have maximal probability of error below , and we are left with codewords, i.e. rate — negligible for large .
Combining: a code of rate with , proving achievability of any rate below capacity.
∎
WarningRandom coding is a proof technique, not a signalling scheme
Codes are selected at random merely to symmetrize the mathematics and show that a good deterministic code exists. The theorem shows good codes exist for long block lengths; it does not provide a way to construct them. Generating a random code will likely give a good one, but without structure it is very hard to decode — naive table lookup needs an exponentially large table. Hence the theorem is not a practical coding scheme.
RemarkThe best code needs no channel to agree on
Since can be found by exhaustive search from the channel description alone, the Kolmogorov complexity of the best code is a small constant. So “revealing to sender and receiver” in step 2 costs nothing: they merely agree in advance to use the best code.
Zero-error codes
Motivation for the converse. The converse argument is clearest if we first run it in the case where absolutely no errors are allowed. We show , and then the general converse will be the same chain with one extra ingredient.
ProofThe zero-error chain
Assume a code with zero probability of error, so the decoder output equals with probability 1 — meaning is determined by , i.e. . Assume uniform, so . Then
where (a) is the data processing inequality applied to the Markov chain , (b) is proved below as the single-letterization lemma using the memorylessness of the channel, and (c) is the definition of information capacity. Hence for any zero-error code and all : .
∎
IntuitionWhat each of the three inequalities costs you
(a) You cannot learn more about the message than the channel input carries — encoding cannot manufacture information. (b) Using the channel times gives you at most times one use — no synergy across uses. (c) Each single use is worth at most by definition. The converse is just these three facts stacked.
Fano’s inequality and the converse
For codes with small but nonzero error, the step fails. The new ingredient is Fano’s inequality, which lower-bounds error probability in terms of conditional entropy — here used in the reverse direction, to bound the residual entropy by the error rate.
The setup: is uniform on , and forms a Markov chain, with .
LemmaFano’s inequality for a codebook
For a DMC with codebook and input message uniformly distributed over values,
ProofApply the general Fano bound with alphabet size
Since is uniform, . Apply the general form with , and weaken .
∎
LemmaUsing a DMC times does not raise the per-use capacity
Let be the result of passing through a DMC of capacity . Then
ProofSingle-letterize via memorylessness, then drop the joint entropy
Step 1: Expand and use memorylessness.
since by the definition of a DMC, depends only on and is conditionally independent of everything else. This is the step that would fail with feedback.
Step 2: Subadditivity of joint entropy. By the independence bound, :
Step 3: Definition of capacity. Each term is at most , so .
∎
IntuitionWhat this lemma rules out
It says there is no economy of scale in using a noisy wire. You might hope that correlating inputs across time uses could squeeze out extra bits; Step 2 shows correlation among the only ever reduces below the sum, never raises it. The best you can do is treat the uses independently.
ProofConverse to the channel coding theorem
If then . Fix the encoding and decoding rules, so , with uniform. Then
where (a) is uniformity of , (b) is an identity, (c) is Fano’s inequality for taking at most values, (d) is the data processing inequality, and (e) is the lemma above.
Divide by :
Letting , the first two terms on the right vanish, so .
∎
FormulaThe converse rearranged as an error floor
IntuitionReading the error floor
If , then is a positive constant and the probability of error is bounded away from 0 for all sufficiently large — and hence for all , since a zero-error code for small could be concatenated into zero-error codes for large . You cannot achieve arbitrarily low error above capacity, no matter how clever the code or how long the block.
RemarkWeak versus strong converse
This is the weak converse. A strong converse also holds: for rates above capacity, the probability of error goes exponentially to 1. So capacity is a very sharp dividing point — below it exponentially, above it exponentially.
Equality in the converse
Motivation. We know works and does not. Examining where the converse chain is tight tells us what a capacity-achieving code must look like — useful guidance for code designers.
Repeating the converse steps with :
| Step | Equality condition | Design meaning |
|---|---|---|
| (a) data processing | and | All codewords are distinct, and is a sufficient statistic for decoding. |
| (b) subadditivity | The are independent | The induced output sequence must look memoryless. |
| (c) definition of | Each coordinate must be distributed according to the capacity-achieving input distribution. |
ImportantWhat a capacity-achieving code looks like
Distinct codewords, and an output whose coordinates are i.i.d. according to the output distribution induced by the optimal input:
The distribution referred to here is the empirical distribution on induced by a uniform distribution over codewords:
In slogan form: a good code makes the channel output look like pure noise.
ExampleNoisy typewriter
Using every alternate input letter gives 13 codewords of block length 1, achieving . If the codewords are chosen i.i.d. uniform on , the channel output is i.i.d. uniform on — exactly as the equality conditions predict.
ExampleBinary symmetric channel
Given any input sequence, every output sequence has positive probability, so we cannot distinguish even two codewords with zero error: the zero-error capacity of the BSC is zero. Still, the conditions inform us: efficient codes induce a distribution that looks i.i.d. Bernoulli(), and at rates close to capacity the decoding sets almost exactly tile the space of output sequences. Above capacity the decoding sets begin to overlap, and the error probability can no longer be made small.
Hamming codes
The problem. The coding theorem promises block codes exist but gives no construction, and a random code is undecodable in practice. Useful codes must also be simple enough to encode and decode efficiently.
IntuitionThe naive scheme and why it fails
The most obvious way to add redundancy is repetition: send 11111 for a 1
and 00000 for a 0. On a BSC the optimum decoder is a majority vote, and an
error occurs only if three or more bits flip. By lengthening the repetition we
can drive error arbitrarily low — but the rate goes to zero with block
length. Simple, but useless. We need redundancy that grows slower than the
message.
The improvement is to combine bits so each extra bit checks a subset of the information bits. The simplest instance is a parity check code: given information bits, choose the th so the parity of the block is even. An odd number of errors is then detected — but not located, and even numbers of errors are missed entirely. Hamming codes extend this to multiple parity checks over overlapping subsets.
Construction
Consider a binary code of block length 7, all operations mod 2. Take all nonzero binary vectors of length 3 as the columns of a matrix:
The codewords are the null space of (vectors with ). Since has rank 3, the null space has dimension , giving codewords:
0000000 0001111 0010110 00110010100101 0101010 0110011 01111001000011 1001100 1010101 10110101100110 1101001 1110000 1111111DefinitionMinimum weight and minimum distance
- Minimum weight: the smallest number of 1’s in any nonzero codeword.
- Minimum distance: the smallest number of places in which two codewords differ.
For a linear code (one closed under addition, as this is, being a null space) the difference of two codewords is a codeword, so minimum distance equals minimum weight.
DerivationWhy the minimum distance here is exactly 3
At least 3: all columns of are different and nonzero, so no single column is zero (weight 1 impossible) and no two columns can add to (weight 2 impossible).
Exactly 3: the sum of any two columns is itself one of the columns of the matrix (all seven nonzero 3-vectors are present), so some three columns do sum to zero, giving a weight-3 codeword.
IntuitionWhy distance 3 gives single-error correction
The minimum distance measures how far apart codewords are, and hence how distinguishable they remain at the channel output. If a codeword is corrupted in one place, the result differs from in 1 place but from every other codeword in at least 2 — so it is unambiguously closest to .
Syndrome decoding
DerivationFinding the error position without searching all codewords
is called the parity check matrix: for every codeword. Let be the vector with a 1 in position . If the codeword is corrupted at position , the received vector is , and
which is exactly the th column of . So computing (three bits) names the corrupted position directly; flipping that bit recovers the codeword. No search over the 16 codewords is required.
RemarkSystematic form
Examining the first 4 bits of the codewords above, they cycle through all combinations — so those 4 bits can carry the message and the other 3 are determined. A code in this form (first bits the message, last the parity checks) is systematic. This code is identified by block length , information bits , and minimum distance : the Hamming code.
ExampleThe Venn diagram picture
Draw three overlapping circles, creating four intersection regions and three regions belonging to a single circle. Place the 4 information bits in the intersection regions, then place a parity bit in each of the three remaining regions so that each circle has even parity.
Now flip one information bit. The parity constraint is violated for exactly the circles that region belongs to — and the only single-bit error that could violate that particular pair of circles is the bit sitting at their intersection. Working through every case shows the code detects and corrects any single-bit error. This is syndrome decoding drawn rather than computed: the three circles are the three rows of .
CorollaryGeneral Hamming codes
Using rows in (i.e. all nonzero binary -vectors as columns) gives a code with block length , information bits, and minimum distance 3. All of these are Hamming codes and correct one error.
Beyond Hamming
NoteThe historical gap between promise and practice
With large block lengths there will usually be more than one error per block, so single-error correction is not enough. For a BSC with crossover we want a code correcting up to errors while carrying information bits.
- 1950s: Reed–Solomon (multiple-error correction, nonbinary); Bose– Ray-Chaudhuri and Hocquenghem generalize Hamming via Galois field theory to -error-correcting BCH codes.
- Until 1972: every known code correcting errors had asymptotic rate 0 — the repetition problem never really went away.
- 1972: Justesen gives codes with positive asymptotic rate and positive asymptotic minimum distance as a fraction of block length.
- 1993: Berrou et al. introduce turbo codes — two interleaved convolutional codes with a cooperative decoder, where each decoder feeds its “opinion” of each bit to the other and iterates until they agree. Surprisingly, this allows efficient decoding at rates close to capacity.
- 1997: MacKay and Neal show an iterative message-passing algorithm achieves near-capacity rates for Gallager’s LDPC codes.
Both turbo and LDPC codes remain active research areas and are deployed in wireless and satellite channels. As an everyday example, compact disc players use two interleaved and Reed–Solomon codes, letting the decoder correct bursts of up to 4000 errors.
RemarkBlock codes versus convolutional codes
Everything above is a block code: it maps a block of information bits to a codeword with no dependence on past blocks. One can also design codes where each output block depends on past inputs as well; a highly structured form of this is a convolutional code.
Feedback capacity
The problem. Suppose all received symbols are sent back immediately and noiselessly to the transmitter, which can use them to decide what to send next. Can we do better? We saw feedback made the BEC trivially easy. Does it raise the rate?
flowchart LR W["Message W"] --> E[Encoder] E --> Xi["X_i(W, Y^(i-1))"] Xi --> CH["Channel p(y|x)"] CH --> Yi["Y_i"] Yi --> D[Decoder] Yi -.->|noiseless feedback| E D --> WH["W-hat"]
DefinitionFeedback code and feedback capacity
A feedback code is a sequence of mappings — each input a function only of the message and the previously received values — together with decoding functions , with for uniform.
The capacity with feedback is the supremum of all rates achievable by feedback codes.
TheoremFeedback does not increase capacity
WarningWhy the old converse proof breaks
is immediate (a nonfeedback code is a special case). The other direction cannot reuse the earlier converse: Lemma 7.9.2 is no longer true, because now depends on past received symbols, so it is false that depends only on and is conditionally independent of future ‘s. The single-letterization step collapses.
ProofRoute the argument through instead of
The fix: instead of bounding , bound — the message is not adaptively chosen, so it is immune to the feedback problem.
Step 1: Fano and data processing, as before. Let be uniform, so :
Step 2: Expand and insert for free.
The first equality here is because is a function of and — precisely the property that broke the old proof is what makes adding to the conditioning set free here. The second is because, conditional on , the output is independent of and of past ‘s.
Step 3: Finish exactly as before.
Step 4: Combine and take limits. ; dividing by and letting gives . Hence .
∎
IntuitionWhat feedback does and does not buy
Feedback can help enormously in simplifying encoding and decoding — the BEC retransmission scheme hits capacity with no code design at all. But it cannot increase the capacity. The reason is visible in Step 2: feedback lets the encoder react, but it cannot change , the noise the wire injects on each use. You can steer better; you cannot make the wire quieter.
Source–channel separation theorem
The problem. We now have two results: data compression (representable at rate ) and data transmission (reliable at rate ). Is necessary and sufficient to send a source over a channel?
Consider sending digitized speech over a DMC. We could design a code mapping speech samples directly into channel inputs, or we could compress the speech and then channel-code the compressed bits. It is not obvious we lose nothing with the two-stage method, since compression does not look at the channel and channel coding does not look at the source.
flowchart LR V["V^n"] --> SE[Source encoder] SE --> CE[Channel encoder] CE --> CH["Channel p(y|x)"] CH --> CD[Channel decoder] CD --> SD[Source decoder] SD --> VH["V-hat^n"]
ImportantWhy we want this to be true
If it is, we can design a communication system as two independent halves: source codes for the most efficient representation of the data, channel codes appropriate for the channel — and their combination is as good as anything designed jointly. This is why everything is reduced to a common binary representation in practice, an enormous reduction in complexity: ATM networks and the Internet let speech, video, and digital data share one channel precisely because of this theorem.
WarningIt is not always true, and two examples show why it can mislead
There are multiuser channels where the decomposition breaks down. And two simple situations look like counterexamples:
- English text over an erasure channel. Compress the text optimally and send it, and the erasures are very hard to decode. Send the English directly and you can lose up to about half the letters and still make sense of it.
- Speech under white noise. The human ear can distinguish speech at very high noise levels, so it may be better to send uncompressed speech than the compressed version.
In both, the redundancy in the source happens to be well suited to the channel. The theorem is an asymptotic statement about achievable rates, not a claim that two-stage systems are better at every finite block length or under a mismatched distortion criterion.
TheoremSource–channel coding theorem
If is a finite-alphabet stochastic process satisfying the AEP and , there exists a source–channel code with .
Conversely, for any stationary process, if the probability of error is bounded away from zero and it is not possible to send the process over the channel with arbitrarily low error.
NoteWhat is assumed about the source
Only that it has a finite alphabet and satisfies the AEP. That covers i.i.d. sequences and the states of a stationary irreducible Markov chain; in fact any stationary ergodic source satisfies the AEP.
ProofAchievability — two-stage encoding
Step 1: Index only the typical source sequences. Since the process satisfies the AEP, there is a typical set of size at most carrying most of the probability. Encode only sequences in the typical set; everything else is declared an error, contributing at most .
Step 2: Count the bits needed. There are at most such sequences, so bits suffice to index them.
Step 3: Ship the index through the channel. By the channel coding theorem we can transmit the index with error below provided
Step 4: Reconstruct. The receiver enumerates and picks the sequence at the estimated index. Union-bounding the two failure modes:
for sufficiently large. So suffices.
∎
ProofConverse — Fano plus data processing, one more time
We show forces , for any source–channel code (possibly random) and any decoder .
Step 1: Fano’s inequality for the whole block.
Step 2: Chain the inequalities.
where (a) is the definition of the entropy rate of a stationary process, (b) is Fano, (c) is data processing along , and (d) is memorylessness of the channel.
Step 3: Take the limit. As , and , leaving .
∎
ImportantThe whole theory in three sentences
Data compression is a consequence of the AEP: a small subset (of size ) of all source sequences carries most of the probability, so we can represent the source with small error using bits per symbol. Data transmission is a consequence of the joint AEP: for long blocks the channel output is very likely jointly typical with the input codeword, while any other codeword is jointly typical with probability , so about codewords still give negligible error. Separation says we can design the two independently and combine them for optimal performance.
A stationary ergodic source can be transmitted over a channel if and only if its entropy rate is less than the channel capacity.
Quick reference
| Object | Statement | Reads as |
|---|---|---|
| Information capacity | The wire’s worth when driven optimally. | |
| Noiseless binary | — | |
| Nonoverlapping outputs | Noise without confusability costs nothing. | |
| Noisy typewriter | A nonconfusable subset hidden in a confusable alphabet. | |
| BSC | One bit, minus the entropy of the flip. | |
| BEC | You keep the fraction that isn’t erased. | |
| Weakly symmetric | Uniform input is optimal. | |
| Joint typicality | three empirical entropies within | The pair is typical of each other. |
| Joint AEP part 3 | A rival codeword fools you with prob. . | |
| Coding theorem | achievable | Reliable communication below capacity. |
| Converse | And nowhere above it. | |
| Error floor | Above capacity, error is bounded away from 0. | |
| Single-letterization | No economy of scale in channel uses. | |
| Hamming | , = column of the error | Syndrome names the corrupted bit. |
| Feedback | Feedback simplifies; it does not enlarge. | |
| Separation | possible iff | Design source and channel codes independently. |
Facts to keep to hand:
- Capacity bounds: ; is concave in , so local max global max.
- No closed form for in general — symmetry is the escape hatch; otherwise Arimoto–Blahut.
- Achievability slack: error , small when .
- The three code surgeries: optimize pick the best codebook discard the worst half of codewords (rate cost , converts average error to maximal).
- Every converse in this chapter is Fano data processing single-letterization. Recognizing that triple is worth more than memorizing any individual chain.
References
- [[lit/cover2006-elements|Cover & Thomas, Elements of Information Theory]] — Chapter 7