Skip to main content
KetQat

Appearance

Topic · intermediate

Coding Theory

The mathematical framework of reliable communication over noisy channels. Channel models, capacity and Shannon's noisy-channel coding theorem, maximum-likelihood and syndrome decoding, and the computational hardness of decoding general linear codes.

ExpositionMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

Overview

Coding theory asks how much information can be sent reliably through a noisy channel and how to do it. It has two halves that were born almost together. Shannon showed that every channel has a capacity: below it, the error probability can be made as small as desired by coding over long blocks; above it, it cannot. Hamming began the search for explicit codes with guaranteed error-correcting power. Shannon's theorem says good codes exist without exhibiting one, and the constructive half of the subject is the effort to approach his limit with codes that can actually be encoded and decoded.

This page covers the framework: channel models, capacity, what an optimal decoder does, and why decoding is hard in general. The codes themselves, their parameters, families and bounds, are on the page Classical Error-Correcting Codes, which this page relies on rather than repeats.

Intuition

A noisy channel does not destroy information so much as blur it: each input could have produced many outputs. If the sender restricts itself to a small set of inputs, the codewords, whose clouds of likely outputs do not overlap, the receiver can tell which was sent. Capacity measures how many such non-overlapping clouds fit, per channel use, when blocks are long.

Long blocks matter because of the law of large numbers. On a channel that flips each bit with probability pp, a block of nn bits suffers close to pnpn flips with high probability; the noise becomes predictable in amount though not in position. A code needs to cope only with these typical noise patterns, of which there are about 2nh(p)2^{n h(p)}, and 2n/2nh(p)=2n(1−h(p))2^n / 2^{n h(p)} = 2^{n(1 - h(p))} clouds of that size fit in the space of all nn-bit words. That count is the capacity of the channel, and the same count reappears for quantum channels with Pauli noise as the hashing bound.

The practical difficulty is the decoder. Finding the most likely codeword among exponentially many is easy to state and, for unstructured codes, intractable. The history of the subject is largely the history of code structures that make this search efficient.

Prerequisites

Elementary probability, including tail bounds for sums of independent variables, and the entropy and mutual information of classical information theory. Linear codes, parity-check matrices and syndromes are defined on the classical codes page.

Mathematical Definitions

A discrete memoryless channel is given by finite input and output alphabets and transition probabilities W(y∣x)W(y \mid x); on a block it acts independently on each symbol. Two channels serve as the standard test cases.

DefinitionBinary symmetric channelEstablished definition

Let 0≤p≤10 \le p \le 1. The binary symmetric channel BSC(p)\mathrm{BSC}(p) has input and output alphabet {0,1}\{0, 1\} and transition probabilities

W(y∣x)={1−py=x,py≠x.W(y \mid x) = \begin{cases} 1 - p & y = x, \\ p & y \ne x . \end{cases}

Used nn times it acts independently on each symbol (it is memoryless): for x,y∈F2nx, y \in \F_2^n,

Wn(y∣x)  =  p d(x,y) (1−p) n−d(x,y),W^n(y \mid x) \;=\; p^{\,d(x, y)}\,(1 - p)^{\,n - d(x, y)} ,

where dd is the Hamming distance. Equivalently y=x+ey = x + e with an error vector ee whose coordinates are independent and equal to 1 with probability pp, independently of xx. The parameter pp is the crossover probability; the case p=1/2p = 1/2 makes the output independent of the input, and a channel with p>1/2p > 1/2 is turned into one with crossover probability 1−p1 - p by complementing the output.

DefinitionBinary erasure channelEstablished definition

Let 0≤ϵ≤10 \le \epsilon \le 1. The binary erasure channel BEC(ϵ)\mathrm{BEC}(\epsilon) has input alphabet {0,1}\{0, 1\}, output alphabet {0,1,?}\{0, 1, ?\} and transition probabilities

W(y∣x)={1−ϵy=x,ϵy=?,0otherwise.W(y \mid x) = \begin{cases} 1 - \epsilon & y = x, \\ \epsilon & y = {?}, \\ 0 & \text{otherwise.} \end{cases}

Used nn times it acts independently on each symbol: each position is erased with probability ϵ\epsilon, independently of the others and of the input, and unerased positions are received without error.

The defining feature is that the locations of the damage are known. For a linear code with parity-check matrix HH, decoding then amounts to solving the linear system HcT=0H c^{T} = 0 for the erased coordinates of cc, which has a unique solution exactly when the erased set contains the support of no nonzero codeword. A decoder for this channel never outputs a wrong codeword; it either succeeds or reports that the solution is not unique.

The first models errors at unknown positions, the second losses at known positions. Their quantum relatives are the bit-flip and depolarizing channels on one side and the erasure channel on the other; see biased noise and erasure.

DefinitionMaximum-likelihood decodingEstablished definition

Let CC be a code of length nn used on a channel with transition probabilities Wn(y∣x)W^n(y \mid x). A decoder is a map from received words yy to codewords, possibly with an extra output "failure". Its block error probability for a transmitted codeword cc is the probability that the output differs from cc.

  • A maximum-likelihood (ML) decoder outputs, for each yy, a codeword c^\hat c maximising Wn(y∣c)W^n(y \mid c) over c∈Cc \in C, ties broken by a fixed rule.
  • A maximum a posteriori (MAP) decoder maximises Pr⁡[c] Wn(y∣c)\Pr[c]\, W^n(y \mid c) for a given prior on codewords. It minimises the average block error probability, and it coincides with the ML decoder when the codewords are equally likely.
  • A minimum-distance decoder outputs a codeword nearest to yy in Hamming distance.
  • A bounded-distance decoder of radius tt outputs the codeword within distance tt of yy if there is one and fails otherwise; for 2t≤d−12t \le d - 1 that codeword is unique.

For a linear code with parity-check matrix HH, a syndrome decoder fixes for every syndrome ss one error ese_s with HesT=sH e_s^{T} = s and outputs y−es(y)y - e_{s(y)}. When each ese_s has minimum weight in its coset it is called a coset leader, and the decoder is a minimum-distance decoder.

These rules are about which codeword to output; they say nothing about how to compute it. On the binary symmetric channel with crossover probability below one half, the ML, minimum-distance and coset-leader syndrome decoders coincide up to the breaking of ties; see the theorem on syndrome decoding.

Theorems

TheoremNoisy-channel coding theoremEstablished result

Let W(y∣x)W(y \mid x) be a discrete memoryless channel with input alphabet X\mathcal{X} and output alphabet Y\mathcal{Y}. Define its capacity

C  =  max⁡PXI(X;Y),C \;=\; \max_{P_X} I(X; Y) ,

the maximum over input distributions PXP_X of the mutual information, in bits, between the input X∼PXX \sim P_X and the output YY distributed according to W(⋅∣X)W(\cdot \mid X).

A code of length nn and rate RR is a set of M=⌈2nR⌉M = \lceil 2^{nR} \rceil codewords in Xn\mathcal{X}^n together with a decoder Yn→{1,…,M}\mathcal{Y}^n \to \{1, \dots, M\}.

  1. Achievability. For every R<CR < C and every ϵ>0\epsilon > 0 there is, for all sufficiently large nn, a code of length nn and rate RR whose probability of decoding error is at most ϵ\epsilon for every transmitted codeword.
  2. Converse. If R>CR > C, there is a constant ϵ0(R)>0\epsilon_0(R) > 0 such that every code of rate RR, of any length, has average probability of decoding error at least ϵ0(R)\epsilon_0(R) when the codewords are used with equal probability.

The theorem is due to Shannon, whose argument for achievability chooses the codewords at random; a complete proof of both parts, by joint typicality and Fano's inequality, is in chapter 7 of Cover and Thomas. No proof is recorded here. The special case of the erasure channel, with linear codes, is proved in full in a separate record.

The theorem is an existence statement. It does not say how to find the codes, and the random codes in its proof have no efficient decoder.

Holds when
  • A discrete memoryless channel, that is, finite input and output alphabets and independent, identical action W(y∣x)W(y \mid x) on each transmitted symbol.
  • No feedback; the encoder and decoder may use arbitrarily long blocks and unlimited computation.
  • The converse stated here is the weak converse (error probability bounded away from zero).

For the two standard channels the capacity has a closed form.

EquationCapacity of the binary symmetric channelEstablished result
CBSC(p)  =  1−h(p),h(p)=−plog⁡2p−(1−p)log⁡2(1−p)C_{\mathrm{BSC}}(p) \;=\; 1 - h(p), \qquad h(p) = -p \log_2 p - (1-p) \log_2 (1-p)

For the binary symmetric channel, I(X;Y)=H(Y)−H(Y∣X)=H(Y)−h(p)I(X; Y) = H(Y) - H(Y \mid X) = H(Y) - h(p), because given XX the output is XX flipped with probability pp. The entropy H(Y)H(Y) is at most 1 bit, with equality for a uniform input, which gives the formula; by the noisy-channel coding theorem this maximum of the mutual information is the capacity. The value appears as an example in Shannon's paper.

The capacity is 1 at p=0p = 0, falls to 0 at p=1/2p = 1/2 and is symmetric under p↦1−pp \mapsto 1 - p. Numerically h(0.11)≈0.4999h(0.11) \approx 0.4999, so a channel that flips 11% of the bits still supports rates up to about one half.

Holds when
  • Memoryless binary symmetric channel with crossover probability 0≤p≤10 \le p \le 1; h(0)=h(1)=0h(0) = h(1) = 0.
  • Capacity in bits per channel use, in the sense of the noisy-channel coding theorem.
EquationCapacity of the binary erasure channelEstablished result
CBEC(ϵ)  =  1−ϵC_{\mathrm{BEC}}(\epsilon) \;=\; 1 - \epsilon

For the binary erasure channel with input distribution Pr⁡[X=1]=π\Pr[X = 1] = \pi, the output reveals XX with probability 1−ϵ1 - \epsilon and nothing otherwise, so I(X;Y)=(1−ϵ) h(π)I(X; Y) = (1 - \epsilon)\, h(\pi), maximised at π=1/2\pi = 1/2. A derivation is in Cover and Thomas.

The capacity equals the expected fraction of unerased symbols. This is what a sender could achieve trivially if told in advance which positions would be erased; the content of the theorem is that the same rate is achievable without that knowledge. Random linear codes achieve it, with a short proof.

Holds when
  • Memoryless binary erasure channel with erasure probability 0≤ϵ≤10 \le \epsilon \le 1.
  • Capacity in bits per channel use, in the sense of the noisy-channel coding theorem.

The general theorem is proved in the cited textbook and not here. The erasure channel is the one case where the achievability half has a short and fully elementary proof, and it shows two further things: linear codes suffice, and the random-coding argument is nothing more than a rank computation.

TheoremLinear codes achieve the capacity of the binary erasure channelEstablished result

Let 0≤ϵ<10 \le \epsilon < 1 and 0<R<1−ϵ0 < R < 1 - \epsilon, and put η=(1−ϵ−R)/2>0\eta = (1 - \epsilon - R)/2 > 0. For every nn and every integer 1≤k≤Rn1 \le k \le Rn with

βn  :=  2−ηn+e−2η2n  <  1\beta_n \;:=\; 2^{-\eta n} + e^{-2 \eta^2 n} \;<\; 1

there is a binary linear code of length nn and dimension kk such that, on the binary erasure channel BEC(ϵ)\mathrm{BEC}(\epsilon), the transmitted codeword is the unique codeword consistent with the received symbols except with probability at most βn\beta_n, for every transmitted codeword.

In particular, taking k=⌊Rn⌋k = \lfloor Rn \rfloor, rates arbitrarily close to the capacity 1−ϵ1 - \epsilon are achieved by linear codes with failure probability tending to zero exponentially fast in nn, and decoding takes O(n3)O(n^3) operations by Gaussian elimination.

Holds when
  • Memoryless binary erasure channel with erasure probability 0≤ϵ<10 \le \epsilon < 1.
  • Decoding is by solving the linear system for the erased positions (which is maximum-likelihood for this channel); no bound on decoding time is claimed beyond that of Gaussian elimination.
  • Only achievability is asserted. That no rate above 1−ϵ1 - \epsilon is achievable is the converse part of the general theorem.
Proof · Proof that random linear codes achieve the erasure-channel capacity

Setting. Let GG be a k×nk \times n binary matrix and encode a message u∈F2ku \in \F_2^k as uGuG. The channel erases a random set E⊆{1,…,n}E \subseteq \{1, \dots, n\}, each position independently with probability ϵ\epsilon. Write GEˉG_{\bar E} for the submatrix of columns outside EE. The receiver knows EE and the vector uGEˉu G_{\bar E}. A message u′u' is consistent with what was received if and only if (u−u′) GEˉ=0(u - u')\, G_{\bar E} = 0. Decoding therefore fails, in the sense that uu is not the unique consistent message, exactly when

there is w∈F2k, w≠0, with w GEˉ=0.\text{there is } w \in \F_2^k,\ w \ne 0, \ \text{with}\ w\, G_{\bar E} = 0 .

This event depends on GG and EE but not on uu. Call its probability over EE Pfail(G)P_{\mathrm{fail}}(G).

Random matrix, fixed erasure set. Let the entries of GG be independent uniform bits and fix EE with s=n−∣E∣s = n - \abs{E} unerased positions. For a fixed w≠0w \ne 0 the vector w GEˉw\, G_{\bar E} is uniformly distributed on F2 s\F_2^{\,s}: choose ii with wi=1w_i = 1; conditioned on the other rows, row ii of GEˉG_{\bar E} is uniform and shifts the sum to a uniform vector. Hence Pr⁡G[ wGEˉ=0 ]=2−s\Pr_G[\, w G_{\bar E} = 0 \,] = 2^{-s}, and by the union bound over the 2k−12^k - 1 nonzero ww,

Pr⁡G[failure∣E]  ≤  2 k−s.\Pr_G[\text{failure} \mid E] \;\le\; 2^{\,k - s} .

Few erasures are likely. Let AA be the event ∣E∣≤(ϵ+η)n\abs{E} \le (\epsilon + \eta) n. The number of erasures is a sum of nn independent indicator variables of mean ϵ\epsilon, so by Hoeffding's inequality Pr⁡[Ac]≤e−2η2n\Pr[A^{c}] \le e^{-2\eta^2 n}. On AA we have s≥(1−ϵ−η)ns \ge (1 - \epsilon - \eta) n and, since k≤Rnk \le Rn and 1−ϵ−R=2η1 - \epsilon - R = 2\eta,

k−s  ≤  Rn−(1−ϵ−η) n  =  −ηn.k - s \;\le\; Rn - (1 - \epsilon - \eta)\, n \;=\; -\eta n .

Averaging. Combining the two estimates, with GG and EE independent,

EG[Pfail(G)]  ≤  Pr⁡[Ac]+max⁡E∈APr⁡G[failure∣E]  ≤  e−2η2n+2−ηn  =  βn.\mathbb{E}_G\bigl[ P_{\mathrm{fail}}(G) \bigr] \;\le\; \Pr[A^{c}] + \max_{E \in A} \Pr_G[\text{failure} \mid E] \;\le\; e^{-2\eta^2 n} + 2^{-\eta n} \;=\; \beta_n .

So at least one matrix G0G_0 has Pfail(G0)≤βnP_{\mathrm{fail}}(G_0) \le \beta_n.

The code has dimension kk. If G0G_0 had rank less than kk there would be w≠0w \ne 0 with wG0=0w G_0 = 0, and decoding would fail for every EE, giving Pfail(G0)=1>βnP_{\mathrm{fail}}(G_0) = 1 > \beta_n. Hence G0G_0 has rank kk, its row space is a linear code of dimension kk, messages correspond bijectively to codewords, and for every transmitted codeword the probability that it is not the unique codeword consistent with the received symbols is at most βn\beta_n.

Decoding. The consistent messages are the solutions of the linear system u′GEˉ=uGEˉu' G_{\bar E} = u G_{\bar E}, found by Gaussian elimination in O(n3)O(n^3) operations.

On the decoding side, the link between the probabilistic notion of an optimal decoder and the algebraic notion of a syndrome is the following.

TheoremOn the binary symmetric channel, coset-leader decoding is maximum-likelihoodEstablished result

Let CC be a binary linear code of dimension kk with parity-check matrix HH, used on the binary symmetric channel BSC(p)\mathrm{BSC}(p) with 0<p<1/20 < p < 1/2, and let yy be the received word.

  1. A codeword maximises the likelihood Wn(y∣c)W^n(y \mid c) if and only if it minimises the Hamming distance d(y,c)d(y, c).
  2. Let e∗e^\ast have minimum weight among all e∈F2ne \in \F_2^n with HeT=HyTH e^{T} = H y^{T}. Then y−e∗y - e^\ast is a maximum-likelihood decision.
  3. Fix one such minimum-weight error ese_s for each syndrome ss, of weight wsw_s. The resulting decoder is correct exactly when the channel error equals ese_s for some ss, so its block error probability is the same for every transmitted codeword and equals
Perr  =  1−∑sp ws (1−p) n−ws,P_{\mathrm{err}} \;=\; 1 - \sum_{s} p^{\,w_s}\,(1 - p)^{\,n - w_s} ,

the sum running over all 2 n−k2^{\,n-k} syndromes.

Holds when
  • C⊆F2nC \subseteq \F_2^n is a binary linear code of dimension kk with parity-check matrix HH.
  • The channel is BSC(p)\mathrm{BSC}(p) with 0<p<1/20 < p < 1/2.
Proof · Proof that coset-leader decoding is maximum-likelihood on the binary symmetric channel

1. For the binary symmetric channel,

Wn(y∣c)  =  p d(y,c) (1−p) n−d(y,c)  =  (1−p)n(p1−p)d(y,c).W^n(y \mid c) \;=\; p^{\,d(y,c)}\,(1-p)^{\,n - d(y,c)} \;=\; (1-p)^n \left( \frac{p}{1-p} \right)^{d(y,c)} .

Since 0<p<1/20 < p < 1/2, the ratio p/(1−p)p/(1-p) lies strictly between 0 and 1, so the likelihood is a strictly decreasing function of d(y,c)d(y, c). Maximising one is minimising the other.

2. The map c↦y−cc \mapsto y - c is a bijection from CC onto the coset y+Cy + C, and y+C={ e:HeT=HyT }y + C = \{\, e : H e^{T} = H y^{T} \,\} because H(y−c)T=HyTH(y - c)^{T} = H y^{T} and the solution set of this linear system is a coset of ker⁡H=C\ker H = C. Under the bijection d(y,c)=wt⁡(y−c)d(y, c) = \operatorname{wt}(y - c). A codeword nearest to yy therefore corresponds to an element of least weight in the coset, and conversely y−e∗y - e^\ast is a codeword nearest to yy. By item 1 it is a maximum-likelihood decision.

3. Let cc be transmitted and ee the channel error, so y=c+ey = c + e and the syndrome is s=HeTs = H e^{T}. The decoder outputs y−es=c+(e−es)y - e_s = c + (e - e_s), which equals cc if and only if e=ese = e_s. The distribution of ee does not depend on cc, and Pr⁡[e=v]=pwt⁡(v)(1−p) n−wt⁡(v)\Pr[e = v] = p^{\operatorname{wt}(v)} (1-p)^{\,n - \operatorname{wt}(v)}. The events {e=es}\{e = e_s\} for different ss are disjoint, so the probability of correct decoding is ∑sp ws(1−p) n−ws\sum_s p^{\,w_s} (1-p)^{\,n - w_s}, whatever codeword was sent.

Finally, the obstruction to doing this efficiently.

TheoremDecoding general linear codes is NP-hardPeer-reviewed result

The following decision problems are NP-complete.

  1. Syndrome decoding (coset weights). Input: a binary matrix HH, a vector ss and an integer w≥0w \ge 0. Question: is there a vector ee of Hamming weight at most ww with HeT=sH e^{T} = s?
  2. Minimum distance. Input: a binary matrix HH and an integer w≥1w \ge 1. Question: is there a nonzero vector cc of Hamming weight at most ww with HcT=0H c^{T} = 0?

Problem 1 was shown NP-complete by Berlekamp, McEliece and van Tilborg, who also proved NP-completeness of deciding whether a code has a codeword of weight exactly ww. Problem 2, which they left open, was settled by Vardy. The proofs are reductions from known NP-complete problems and are not reproduced here.

Consequently, unless P=NP\mathrm{P} = \mathrm{NP}, there is no polynomial-time algorithm that performs minimum-distance decoding for every linear code, and none that computes the minimum distance of every linear code.

The statement is about arbitrary codes in the worst case. It does not prevent specific families from having fast decoders, and it does not by itself say that decoding a random code is hard, which is the stronger assumption underlying code-based cryptography.

Holds when
  • Worst-case complexity over all binary matrices HH; the input is the matrix itself, with no promise of structure.
  • The statements concern decision problems; the corresponding search problems are at least as hard.

Worked Examples

Capacity and three simple schemes at p = 0.1

On BSC(0.1)\mathrm{BSC}(0.1) the capacity is 1−h(0.1)≈1−0.4690=0.53101 - h(0.1) \approx 1 - 0.4690 = 0.5310 bits per use.

Uncoded. Sending 4 bits raw, at rate 1, the block arrives intact with probability 0.94=0.65610.9^4 = 0.6561, so the block error probability is 0.34390.3439.

Repetition code [3,1,3][3, 1, 3], majority vote. Decoding fails when two or three bits flip: 3p2(1−p)+p3=0.027+0.001=0.0283p^2(1-p) + p^3 = 0.027 + 0.001 = 0.028 per encoded bit, at rate 1/31/3.

Hamming code [7,4,3][7, 4, 3], syndrome decoding. The coset leaders are the zero vector and the seven vectors of weight 1, so by the theorem on syndrome decoding

Perr=1−(1−p)7−7p(1−p)6=1−0.4783−0.3720=0.1497P_{\mathrm{err}} = 1 - (1-p)^7 - 7p(1-p)^6 = 1 - 0.4783 - 0.3720 = 0.1497

for a block of 4 message bits, at rate 4/7≈0.5714/7 \approx 0.571. That rate is above capacity, and the code is not rescued by its structure: by the converse, no code of rate 4/74/7 can have small error on this channel. At p=0.01p = 0.01, where the capacity is 0.9190.919, the same code gives Perr≈0.0020P_{\mathrm{err}} \approx 0.0020 against 0.03940.0394 uncoded. A single short code is good only for sufficiently weak noise; Shannon's theorem is about what happens as the block length grows at fixed rate.

Coset leaders and ties

Let C={0000,1011,0101,1110}C = \{0000, 1011, 0101, 1110\}, a [4,2,2][4, 2, 2] code with parity checks x1+x3=0x_1 + x_3 = 0 and x1+x2+x4=0x_1 + x_2 + x_4 = 0. The four cosets and their minimum-weight elements are:

  • syndrome 0000: the code itself, leader 00000000;
  • syndrome 1111: {1000,0011,1101,0110}\{1000, 0011, 1101, 0110\}, leader 10001000;
  • syndrome 1010: {0010,1001,0111,1100}\{0010, 1001, 0111, 1100\}, leader 00100010;
  • syndrome 0101: {0100,1111,0001,1010}\{0100, 1111, 0001, 1010\}, two candidates, 01000100 and 00010001.

A flip of bit 2 and a flip of bit 4 are indistinguishable, as they must be for a code of distance 2: their sum 01010101 is a codeword. Whichever leader is chosen, the decoder is maximum-likelihood, and Perr=1−(1−p)4−3p(1−p)3P_{\mathrm{err}} = 1 - (1-p)^4 - 3p(1-p)^3. Maximum-likelihood decoding is not the same as correcting all errors up to some weight; it is the best that can be done with the cosets the code provides.

Erasures: where the rank argument bites

Take a random [n,k][n, k] linear code with n=1000n = 1000, k=500k = 500 on BEC(0.3)\mathrm{BEC}(0.3). About 700 positions survive. Decoding fails only if the 500×700500 \times 700 matrix of surviving columns of the generator matrix has rank below 500, and the union bound in the proof gives probability at most 2500−700=2−2002^{500 - 700} = 2^{-200} for exactly 700 survivors. Failure becomes likely only when fewer than about 500 positions survive, that is, when the erased fraction approaches 1−R=0.51 - R = 0.5; the capacity 1−ϵ1 - \epsilon is exactly the statement that RR must stay below the surviving fraction.

Applications

  • Quantum error correction. A stabilizer code turns the decoding of Pauli errors into syndrome decoding of a classical code over a four-letter alphabet, with one change: errors that differ by a stabilizer are equivalent, so the optimal decoder maximises the total probability of a class of errors rather than of a single error. See stabilizer codes and quantum decoders.
  • Quantum capacities. The quantum analogues of the coding theorem are the subject of quantum Shannon theory.
  • Erasure conversion. The factor of two between correctable erasures and correctable errors is the reason hardware that flags its own faults is valuable; see biased noise and erasure.

Computational Complexity

Encoding a linear code costs O(nk)O(nk) bit operations. Maximum-likelihood decoding by table lookup needs a table of 2 n−k2^{\,n-k} coset leaders, and by exhaustive search a pass over 2k2^k codewords; both are exponential in nn at fixed rate. By the hardness theorem above no method is polynomial for all linear codes unless P=NP\mathrm{P} = \mathrm{NP}, and computing the minimum distance is equally hard. On the erasure channel, by contrast, maximum-likelihood decoding of any linear code is Gaussian elimination, O(n3)O(n^3).

Structured families escape the hardness result: bounded-distance decoding of Reed–Solomon and BCH codes is polynomial (Huffman and Pless), and iterative decoding of LDPC codes takes time linear in nn per iteration (Gallager, Richardson and Urbanke), though it is not maximum-likelihood.

Limitations and Common Pitfalls

  • Capacity is asymptotic. The theorem promises small error for long enough blocks. At a fixed finite length the best achievable rate is below capacity, and how far below is a separate, finer question.
  • Existence is not construction. The random codes of the achievability proof have no efficient decoder. A scheme "achieves capacity" in a practically meaningful sense only if encoding and decoding are efficient as well.
  • Block error and bit error are different quantities. The numbers in the examples are block error probabilities. A decoder optimal for one criterion need not be optimal for the other.
  • Minimum distance does not determine performance on a random channel. It controls the worst case. Two codes with the same [n,k,d][n, k, d] can have different error probabilities, which depend on the whole set of coset leaders.
  • Maximum-likelihood needs the right likelihood. Nearest-codeword decoding is maximum-likelihood on the binary symmetric channel with p<1/2p < 1/2. For asymmetric noise, noise with memory, or soft outputs, the most likely codeword is generally not the nearest one in Hamming distance.
  • Worst-case hardness is not average-case hardness. NP-completeness of syndrome decoding concerns the hardest instances over all codes; it does not by itself imply that typical instances are hard, nor that any particular family is.

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. C. E. Shannon (1948). A Mathematical Theory of Communication. Bell System Technical Journal 27 (3), 379-423. doi:10.1002/j.1538-7305.1948.tb01338.x
  2. Thomas M. Cover, Joy A. Thomas (2005). Elements of Information Theory. Wiley (2nd edition). doi:10.1002/047174882X
  3. R. W. Hamming (1950). Error Detecting and Error Correcting Codes. Bell System Technical Journal 29 (2), 147-160. doi:10.1002/j.1538-7305.1950.tb00463.x
  4. W. Cary Huffman, Vera Pless (2003). Fundamentals of Error-Correcting Codes. Cambridge University Press. doi:10.1017/CBO9780511807077
  5. Tom Richardson, Rüdiger Urbanke (2008). Modern Coding Theory. Cambridge University Press. doi:10.1017/CBO9780511791338
  6. E. Berlekamp, R. McEliece, H. van Tilborg (1978). On the inherent intractability of certain coding problems. IEEE Transactions on Information Theory 24 (3), 384-386. doi:10.1109/TIT.1978.1055873
  7. A. Vardy (1997). The intractability of computing the minimum distance of a code. IEEE Transactions on Information Theory 43 (6), 1757-1766. doi:10.1109/18.641542
  8. R. Gallager (1962). Low-density parity-check codes. IRE Transactions on Information Theory 8 (1), 21-28. doi:10.1109/TIT.1962.1057683

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Topic body only (embedded records carry their own states). All numbers recomputed: 1-h(0.1) = 0.5310, uncoded 0.3439, repetition 0.028, Hamming [7,4] block error 0.1497 at p = 0.1 and 0.00203 vs 0.0394 at p = 0.01 with capacity 0.919; the [4,2,2] code's parity checks, cosets and leaders enumerated; union bound 2^(500-700) re-derived. Narrative claims compared with Shannon (1948) Thm 11 and MacKay (open PDF) ch. 9-10; Hamming (1950), Gallager (1962) metadata checked on Crossref. The Huffman-Pless and Richardson-Urbanke pointers were not verified (not openly readable).

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
  2. 2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10

Current revision 62a142608bcdd925. Source file knowledge/records/topic/coding-theory.md in the content repository (readable there once it is public).