Asymptotic Hamming bound 2026-10-14
The Hamming bound packs disjoint balls of radius approximately . Taking logarithms and using the Hamming ball volume exponent gives the bound for .
// Target: algebra.bigb
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]
https://zoo.cs.yale.edu/classes/cs323/doc/Hamming.pdf. Hamming, Error Detecting and Error Correcting Codes, 1950
Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 33 2 Solution Created 2026-10-03 Updated 2026-10-14
For an -qubit quantum code with projector , the quantum code distance isHere the weight counts nonidentity tensor factors. Thus every error supported on fewer than qubits is detectable, by the Pauli expansion of a quantum error. A scalar action on the code, including a nonidentity stabilizer, is harmless and does not reduce this distance. For a stabilizer code, the equivalent definition minimizes weight among Pauli operators which commute with every stabilizer generator but act nontrivially on the logical information. The Knill--Laflamme condition then guarantees correction of all errors of weight at most , since each pairwise product has weight at most .
Suppose the code encodes logical qubits and is nondegenerate for all errors through weight . There aredistinct Pauli errors modulo phase: choose the affected positions and choose or at each. Each error is unitary, so its image of the code has dimension . Nondegeneracy makes these images mutually orthogonal, equivalently the combined vectors are orthonormal. They all lie in the physical Hilbert space of dimension . Counting dimensions proves the quantum Hamming boundThis dimension argument requires nondegeneracy. For a degenerate code, different errors can share an image, as in the Shor code, and this counting proof cannot be applied unchanged.
For a binary classical code of words, the Hamming bound is : disjoint Hamming balls around the words must fit into all binary strings. The quantum factor is needed because at each erroneous qubit there are three linearly independent nonidentity Pauli operators, not just a classical bit flip. A phase flip is invisible to a computational-basis classical record but changes a quantum superposition. A error combines bit and phase effects, and the identity with spans every one-qubit operator. Quantum correction must protect amplitudes and coherences, and consequently count whole orthogonal logical subspaces rather than just classical words.
For parameters , , andThus a nondegenerate such code saturates the bound: the sixteen two-dimensional error images exhaust the physical space. It is a perfect quantum error-correcting code for single-qubit errors. It also has the smallest possible length for nondegenerate single-error protection of one logical qubit: for , the required inequality fails.
Here is an explicit realization and its five-qubit stabilizer syndrome table. Write tensor products without multiplication symbols and useEach pair has an even number of anticommuting single-site factors, so the four stabilizer generators commute. Their binary Pauli labels are independent: no nonempty product has identity label. For example, the -support at site three fixes the exponent of in such a product to zero, site five then fixes that of , site one fixes that of , and site two fixes that of . Thus their group has sixteen elements and excludes . The common eigenspace has projector and dimension , since all nonidentity Pauli strings have zero trace.
Record a syndrome bit as one when an error anticommutes with the corresponding generator, in order . Direct local commutation givesThese are all fifteen nonzero four-bit error syndromes; the identity has . Distinct errors in this list have a product with nonzero syndrome, so it anticommutes with some . Inserting on both sides gives . The diagonal product is the identity. Hence the Knill--Laflamme condition is exactly , proving nondegenerate correction. Measure the four commuting checks, apply the unique indicated Pauli error again, and every logical state is recovered. The Pauli expansion of a quantum error extends this recovery to an arbitrary one-qubit noise channel, not just the fifteen discrete errors.
The table also proves that every Pauli operator of weight one or two has nonzero syndrome: a weight-two operator is the product of distinct single-site errors, whose syndromes differ. Therefore the distance is at least three. The operators and commute with all four generators and anticommute with each other. They are nontrivial logical Pauli operators. Multiplication of by gives , a weight-three operator with the same logical action; it cannot be scalar on the code because it anticommutes with the invertible logical operator . This proves exactly.
The code consequently detects every two-qubit error and corrects two known-location erasures by the quantum erasure correction criterion, but it cannot correct all two-qubit errors of unknown location. A nontrivial weight-three logical operator can be split into a weight-one and a weight-two error, whose pairwise product violates the correction condition. It also saturates the quantum Singleton bound, since . These properties distinguish single-error perfectness from unrestricted protection against larger errors.
Past exam of the mathematics course of the University of Cambridge 2006 iii Paper 30 3 a Solution Created 2026-10-03 Updated 2026-10-14
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 isFor 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. ThusThe 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 scalesEquivalently, the optimal code rate satisfiesThese are bounds on the rate, not a claim that the optimal rate has a known limit or equals either endpoint.
Past exam of the mathematics course of the University of Cambridge 2006 ii Paper 3 4G Solution Created 2026-09-24 Updated 2026-10-14
A binary block code is a subset ; its length is the common word length , its size is , and its minimum distance is the least Hamming distance between distinct words. There are words in a radius- Hamming ball, since one chooses the positions to change.
Put . Two radius- Hamming balls about different codewords cannot meet: otherwise the triangle inequality would make their centres at distance at most . Comparing their combined size with gives the Hamming boundFor the other direction, start with one word and repeatedly add any word at distance at least from every word already selected. Finiteness ensures that this process stops. At that point the radius- Hamming balls cover the entire cube; an uncovered word could otherwise be added. These balls may overlap, but their total size is at least . This gives the Gilbert–Varshamov bound
Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 31 3 Solution Created 2026-10-03 Updated 2026-10-14
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 andfor 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 provesNo 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 boundOne 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 providedSet 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 entropywith 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 isFor , 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 byThe 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 boundThe covering radii have fraction tending to , giving the asymptotic Gilbert–Varshamov boundFor 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 towhere is the binary entropy function.
Past exam of the mathematics course of the University of Cambridge 2024 ii Paper 2 3K a Solution Created 2026-09-24 Updated 2026-09-25
The original binary Hamming code has parameters , so it has codewords. Its minimum distance three makes the radius-one balls about its codewords disjoint. Each ball hasvectors, and , the size of the ambient space. Equality in the Hamming bound therefore shows that these balls partition : the code is perfect.
Past exam of the mathematics course of the University of Cambridge 2026 ii Paper 1 11H b iv Solution Created 2026-09-24 Updated 2026-09-25