The asymptotic rate-distance function is . It is the best asymptotic code rate available at the specified relative minimum distance. A limsup is used because the definition does not assume an ordinary limit exists.
// Target: algebra.bigb
Channel capacity Created 2026-09-24 Updated 2026-10-14
Channel capacity is the best reliable information rate available through a specified communication channel. For a discrete memoryless channel with finite input and output alphabets, fixed transition probabilities , and no input-cost constraint, it is
in bits per channel use, when the mutual information uses base-two logarithms. The maximization varies the input probability distribution, while keeping the communication channel fixed. A large input alphabet or a large output information entropy alone does not determine how much information gets through: the receiver needs information about the input, rather than merely unpredictable output.
The operational meaning comes from the Shannon second coding theorem. A block code represents one of possible messages by a word of length , giving a rate bits per use. Take the message label from the uniform distribution on a finite set of those choices when measuring average decoding-error probability. For every fixed rate , there are sequences of such block codes whose decoding-error probability tends to zero as grows; a rate above cannot have vanishing decoding-error probability. This is an asymptotic limit, rather than a promise that an arbitrary finite block code at a rate below works well. See MIT 18.310, Shannon's Noisy Coding Theorem, sections 1–2.
For a binary symmetric channel with crossover probability , the binary symmetric channel capacity is approximately bits per use. Thus a binary code rate lies below the limit, while lies above it. At , two transmitted symbols represent one message bit on average; the redundancy helps distinguish messages after noise. This does not split individual physical symbols into fractional pieces.
The result is useful because it separates two tasks. Computing channel capacity establishes the target imposed by the transition probabilities; constructing an effective block code attempts to approach that target with acceptable delay and decoding effort. The surprise is that reliability can improve indefinitely without forcing every positive rate to disappear. In his 1948 paper, Shannon defines noisy channel capacity in section 12 and develops its operational significance in section 13, Theorem 11. His original formulation uses information per unit time; the fixed-duration channel-use convention here expresses the same rate question per symbol. [ref].
Channel code 2026-10-25
A deterministic fixed-length channel code consists of a channel encoder and a channel decoder . It represents possible messages by length- input codewords for a communication channel, and estimates the message from the resulting output word. Its code rate is bits per channel use. The maximal decoding error probability requires reliable recovery of every message, while an average error criterion depends on the chosen message probability distribution.
Channel feedback 2026-10-25
Information about earlier received outputs made available to the channel encoder while choosing subsequent inputs. For repeat-until-success coding over an erasure channel, an erasure report tells the sender to repeat the current bit, while a success report tells it to advance. A forward code rate calculation must specify whether this return communication is supplied freely or included in the resource count.
Coding theory Created 2026-09-24 Updated 2026-10-18
Coding theory studies representations of messages that make decoding efficient, reliable, or compact. In channel coding, messages are mapped to separated codewords, so a corrupted word can still be recognized as coming from one particular message. In lossless source coding, a prefix code instead assigns short descriptions to frequent symbols. The objectives differ, but both exploit structure in the set of allowed words.
The simplest error-correction example sends as and as . If the receiver sees , at most one bit flip is consistent with , whereas two flips would be needed to obtain it from . A repetition code therefore recovers the original by taking the majority function of the received bits. The Hamming distance between the valid codewords is three: the spaces of one-error outputs around them do not overlap. This turns error correction into geometry in a discrete space.
The central tradeoff is between code rate and minimum distance. Additional separation makes correction possible but leaves fewer words available for messages at a fixed length. The Hamming bound counts disjoint error neighborhoods, while linear codes turn encoding and error detection into computations with matrices over finite fields. These connections explain why combinatorics, linear algebra, and probability theory all enter the subject.
Richard W. Hamming's Error Detecting and Error Correcting Codes appeared in the Bell System Technical Journal in April 1950, pp. 147–160. Its introduction motivates automatic correction through failures in digital computing, and its constructions go beyond detecting an error to identifying and correcting its location.[ref]
For a deterministic length- channel code with messages on a binary erasure channel of erasure probability , exclude the message decoded from the all-erased output. Under a uniform choice of the other messages, success probability is at least . Conditional on an erasure pattern with unerased positions, there are at most output words, so average success is at most . With no unerased positions it is zero.
Put . The scalar bound is immediate for . Otherwise set . Since for ,
The inequality follows because equality holds at and the derivative of is for . Averaging the scalar bound over the number of unerased positions, with , proves the displayed claim. Thus implies code rate . The cases satisfy this rate bound directly.
Deterministic decoding is essential to this version: on an always-erased channel, a randomized uniform guess has maximal decoding error probability despite receiving no information. The usual deterministic channel decoder has maximal error one when on that channel.
For a discrete memoryless channel with transition probabilities , the conditional probability of a length- output given a length- input factors as
The same transition probabilities apply at each use. Its channel capacity is
The unit is bits per channel use. For finite alphabets the maximum exists by continuity on the probability simplex; with more general alphabets one uses a supremum when appropriate.
An channel code consists of an encoder and a decoder . It represents each of messages by input symbols and recovers a message from the observed output symbols. Its code rate is bits per use. For each message , its conditional error probability is ; an average error also specifies the message probability distribution, while the maximum error takes the largest conditional error.
Solutions to all three questions.[ref] All logarithms are base two; information entropy is measured in bits and code rates in bits per channel use. Terms are zero. Question 3(b) contains an incorrect hint; its requested conclusion is proved directly below for deterministic channel codes. The repeat-until-success protocol in Question 3(c) requires to terminate.
Use the standard deterministic channel encoder and channel decoder, with message labels and code rate . The Fano's inequality hint printed here replaces by , which is false in general: take uniform on and in the common alphabet . The error probability is one and its binary entropy is zero, so the proposed bound asserts . The correct Fano's inequality alone gives , which does not immediately give the requested additive . The following erasure-pattern counting bound for maximal decoding error proves the displayed claim directly.
The case is immediate because . Suppose , put , and let be the message that the channel decoder returns on the all-erased output. Choose uniformly among the other messages. Every one of these messages is decoded correctly with probability at least , by the assumed maximal decoding error probability bound.
Let be the random set of unerased coordinates and . For each fixed with , at most output words are possible. A deterministic channel decoder can correctly identify at most one message per output word, so its conditional success probability, averaged over these messages, is at most . When , success is zero because was excluded.
For every integer ,
If , this is immediate. If , write . The elementary inequality for gives
where the middle inequality is . This proves the needed scalar bound.
Taking the expectation over erasure patterns, and using , yields
Consequently the requested bound is valid:
The use of maximal decoding error probability matters: excluding one message preserves the lower bound on success. The deterministic channel decoder convention also matters; allowing independent randomized guessing would invalidate this particular finite-length claim at .
For , the total number of forward channel uses is , so the random code rate of a message with bits is
The independent and identically distributed random variables have finite expectation . By the strong law of large numbers,
Thus the protocol reaches the binary erasure channel channel capacity in its asymptotic forward throughput while guaranteeing zero error on every completed message. Its random transmission length and use of channel feedback distinguish it from the fixed-length channel codes in part (b). Independent erasure indicators suffice for this calculation; the message bits themselves need not be independent or uniformly distributed. At , the algorithm never produces a completed transmission, so as a completed-code rate is undefined; the physical throughput is zero.
Write for the largest number of codewords in a binary length- code with minimum Hamming distance at least . The volume of a Hamming ball does not depend on its centre and is
For the Hamming bound, put . The radius- Hamming balls around distinct codewords are disjoint: a point belonging to two such balls would, by the triangle inequality for Hamming distance, put their centres at distance at most . Counting points in the binary cube therefore gives
For the Gilbert–Varshamov bound, choose a code maximal under inclusion among those with minimum Hamming distance at least , for example by successively adding any allowable word. Its radius- Hamming balls cover the cube. Otherwise an uncovered word would be at distance at least from every codeword and could be added, contradicting maximality. Thus
The lower bound is an existence assertion about a suitable code, while the upper bound holds for every such code. Together they give
Let be the binary entropy. For ,
The assumed Hamming ball volume exponent applies also to any integer radii with . Indeed, for each small these radii eventually lie between and . monotonicity of sandwiches its normalized logarithm between limits and ; continuity then lets tend to zero. Consequently the asymptotic Gilbert–Varshamov bound and asymptotic Hamming bound have respective exponential scales
Equivalently, the optimal code rate satisfies
These are bounds on the rate, not a claim that the optimal rate has a known limit or equals either endpoint.
The Shannon second coding theorem says that a memoryless channel permits transmission at any fixed code rate with error probability tending to zero as block length tends to infinity. Conversely, a sequence of codes with error probability tending to zero cannot have a limiting rate above . The channel capacity, in bits per use, is
For a finite discrete memoryless channel with transition probabilities , the supremum is a maximum and its mutual information is
For a general memoryless channel, mutual information is the relative entropy of the joint input-output law with respect to the product of its marginal laws; the same supremum is taken over the admissible input laws.
For the binary symmetric channel, write with independent noise having Bernoulli distribution of parameter . Given either input bit, the output conditional entropy is . Thus
An input with uniform distribution makes the output have uniform distribution, attaining . The binary symmetric channel capacity is therefore
To correct every pattern of errors by nearest-codeword decoding, it suffices to have minimum Hamming distance : the corresponding radius- Hamming balls are disjoint. For , the relative distance tends to , so the asymptotic Gilbert–Varshamov bound guarantees code rate at least in the limit. Therefore its immediate strict-rate guarantee is
The binary entropy is strictly increasing from zero to one on , since on . Let denote the inverse on this interval. The asymptotic condition becomes
There is also a finite-length boundary refinement for the precise requirement of correcting errors. If , then each weight for is at least . Expanding gives the entropy bound for a Hamming ball
The case follows directly from . Taking and using monotonicity of the binary entropy, the Gilbert–Varshamov bound yields
Thus the worst-case correction guarantee from the Gilbert–Varshamov bound even includes for the exact radius , with the number of messages rounded to an integer when necessary. No positive-rate guarantee of this form is obtained for ; one must not extend the increasing-entropy calculation past . Failure of this sufficient bound does not rule out better codes.
By contrast, the Shannon second coding theorem gives vanishing error probability on the binary symmetric channel whenever
The factor of two comes from demanding disjoint correction balls for every error pattern of a prescribed weight. This is a worst-case distance requirement, and the Gilbert–Varshamov bound is itself only a sufficient existence bound. The Shannon second coding theorem controls the probability of decoding failure for the random channel; rare bad patterns may remain.
Finally, the number of actual errors has binomial distribution with mean . Correcting exactly its mean does not itself imply error probability tending to zero. To get that conclusion from the distance construction when , choose with and , and correct errors. The weak law of large numbers then makes the probability of exceeding the correction radius tend to zero.
Figure 1.
Binary symmetric channel capacity and Gilbert–Varshamov worst-case correction rate
. Details.
We give the bounds for an alphabet of size , including the binary case . Let be a length- code with codewords and minimum Hamming distance at least , where . Write for the maximum code size at a given distance and
for the number of words in a Hamming ball of radius . The th term chooses the changed coordinates and the alternative symbols in each.
For the Hamming bound, put . Balls of radius around distinct codewords are disjoint: a common point would, by the triangle inequality, make their distance at most . Counting those balls inside the ambient words proves
No linearity is needed. For a linear code of dimension over , replace by .
For the Gilbert–Varshamov bound, construct a code greedily, adding any word at distance at least from all previously selected words, until none remains. The process terminates because the space is finite. Its maximality implies that the radius- balls around its codewords cover the whole space: an uncovered word could have been added. These balls may overlap, but the size of their union is at most the sum of their sizes. Hence the constructed code has , proving the existence bound
One may take the ceiling on the right because code size is integral.
For completeness, the sharper linear version is the Varshamov bound for linear codes. When is a prime power and , an linear code exists provided
Set and choose columns of an parity-check matrix in order. When choosing column , exclude all combinations of at most earlier columns, including the zero combination. There are at most forbidden vectors, smaller than by the assumed inequality. A column can therefore be chosen. Inductively every set of at most chosen columns is independent: a relation involving the newest one would express it as a combination of at most earlier columns. The kernel has dimension at least and minimum Hamming distance at least , since a low-weight kernel vector would be such a column relation. If its dimension is larger than , take a -dimensional subspace. This proves the stated linear existence claim; it does not assume the greedy nonlinear code was linear.
To derive the asymptotic bounds, define the q-ary entropy
with the continuous endpoint conventions. Its derivative is , so it is increasing on and has maximum one at . Stirling's formula gives, uniformly for integer ,
The sum defining is between its largest summand and times that summand. For radius fractions tending to , monotonicity of makes the largest exponent tend to . Consequently the Hamming ball volume exponent is
For , the exponent is one: use a radius fraction just below for a lower bound and for an upper bound.
Set and define the asymptotic rate-distance function by
The code rate is and the relative minimum distance is . A limsup suffices; no unproved existence of a limit for optimal code sizes is required. The packing radii have fraction tending to , so the finite Hamming bound and the volume exponent give the asymptotic Hamming bound
The covering radii have fraction tending to , giving the asymptotic Gilbert–Varshamov bound
For larger , this covering argument gives only the trivial lower bound zero, not the expression obtained by extending the decreasing information entropy function beyond its maximum.
The asymptotic lower bound is also achievable by linear codes over a finite field. For and sufficiently large , take redundancy , so . The linear existence condition produces dimension at least ; its rate has liminf at least . At , use the whole space, of rate one. In particular, for binary codes the bounds reduce to
where is the binary entropy function.
Use the binary Hamming code , where the th column of the parity-check matrix is the four-digit binary expansion of , for . Thus the columns are precisely the nonzero vectors of . They include the four coordinate vectors, so and . Its code rate is therefore .
For a received word , compute its syndrome . If , report no error. Otherwise identify the unique column and flip bit . Indeed, if with , then , so this procedure recovers exactly. No column is zero and no two columns coincide; hence no nonzero codeword has Hamming weight one or two. Some three columns sum to zero, for example those indexed by , so the minimum distance is exactly three. Thus every single-bit error is corrected. The assertion requires at most one error; arbitrary multiple errors need not be detected by this procedure.
With channel feedback, resend each message bit through a binary erasure channel until a non-erased copy arrives, then move to the next bit. The channel decoder deletes erasure symbols, giving the message without error whenever transmission completes. For , the waiting times have an independent and identically distributed geometric distribution with expectation , so every finite message completes almost surely. The strong law of large numbers gives forward code rate , matching channel capacity. At , transmission never completes. Independent erasure indicators, rather than independent message bits, are the essential hypothesis.
Repetition code Created 2026-10-03 Updated 2026-10-14
A binary repetition code represents one bit by repeating it times, using codewords and . Their Hamming distance is , and the code rate is . For odd , the majority function recovers the input whenever fewer than half the positions have flipped. Even allows a tied vote, so a decoder must specify how it handles that case.
For , the received words decode to zero; decode to one. The decoder therefore corrects every single flip. This guarantee concerns the number of flipped positions, independent of any probabilistic model.
If each position passes independently through a binary symmetric channel with crossover probability , a decoded error requires at least two flips. The binomial distribution gives
At , the uncoded error probability is , while the three-bit code's decoded error probability is . This improvement costs three transmitted bits per message bit. For , ; for , one should first exploit the known tendency to invert symbols rather than applying the same majority rule blindly.
Figure 1.
Three-bit majority decoding corrects one flip and lowers the error probability at the cost of rate
. Details.
Independent flips are an essential assumption for the displayed formula. If a single common disturbance flips all three positions together with probability , repetition provides no improvement. More efficient error-correcting codes distribute redundancy across larger message blocks; repetition is useful as a transparent example of the geometry and the reliability–rate tradeoff.
A binary code rate is guaranteed with correction of every error pattern of Hamming weight at most when and . Choose minimum Hamming distance . The Gilbert–Varshamov bound and entropy bound for a Hamming ball give at least codewords. To deduce vanishing error probability for a binary symmetric channel with crossover probability , use strict inequality in the rate condition and a correction radius ; the weak law of large numbers then controls the tail. Correcting exactly the mean number of errors does not by itself ensure reliable transmission.
// Target: algebra.bigb