Extended Hamming code 2026-10-14
Adding an overall parity bit to the Hamming code of length seven gives an eight-bit linear code with minimum Hamming distance four: every resulting weight is even, every original nonzero weight is at least three, and a weight-three word extends to weight four. Thus it detects up to three errors when testing codeword membership and corrects one error. Joint single-error correction and double-error detection uses the overall parity together with the seven-bit syndrome.
Finite-field discrete Fourier transform 2026-10-14
If is a primitive th root in a finite field and the field characteristic does not divide , the inverse transform is . The identity unless , when the sum is , proves inversion. For a primitive cyclic Reed-Solomon code, encoding assigns the unconstrained transform values and makes the remaining values zero; received transform values at those zeros are syndromes.
Hamming code of length seven 2026-10-14
The binary linear code known as the Hamming code of length seven is the kernel of a parity-check matrix whose columns are all the nonzero vectors of . Its dimension is four. No one-column or two-column sum vanishes, but some three-column sum does, so its minimum Hamming distance is three. The syndrome of a one-bit error is its column, uniquely identifying the erroneous position.
Nested-code CSS syndrome recovery 2026-10-14
For binary linear codes , the coset superpositions of the CSS code have checks labelled by and checks by . A bit-error pattern gives the classical syndrome for , and a phase-error pattern gives the syndrome for the dual code . Errors with and are jointly correctable. Every pairwise Pauli-error product either anticommutes with a check, giving zero code compression, or its low-weight components belong to the stabilizer and give scalar compression. Thus the Knill--Laflamme condition covers coherent superpositions and quantum channels as well as definite bit and phase errors.
Past exam of the mathematics course of the University of Cambridge 2001 iii Paper 25 1 Solution Created 2026-10-03 Updated 2026-10-14
Use binary linear codes , with dimensions . For each coset in , defineRepresentatives of one coset give the same vector, and distinct cosets have disjoint computational supports, so these vectors are orthonormal. Their span is the CSS code , encoding .
For , write and . The code is stabilized by for , because it permutes the sum, and by for , because . These Pauli operators commute: . There are independent stabilizer generators, so their common positive eigenspace has dimension ; it is exactly the span above.
The commuting check measurements separate the two types of error. A bit error changes the signs of the checks by , giving the ordinary syndrome of for . A phase error changes the checks by , giving the syndrome of for the dual code . If corrects bit errors and corrects bit errors, these checks identify the respective patterns, and inverse Pauli operations recover the state without revealing the logical coset. This is the nested-code CSS syndrome recovery procedure.
The sharper distances account for harmless stabilizer errors. A Pauli commutes with every check precisely when and . Among these, it acts as a stabilizer, up to a phase, precisely when and . To justify the latter assertion, with permutes distinct logical cosets, while with has unequal signs on two such cosets. Neither can act as a scalar, and a combined operator has the same nontrivial permutation or phase distinction. For positive logical dimension setThe quantum code distance is : a nontrivial logical Pauli has at least one nonstabilizer component of weight at least the corresponding distance, while a pure or pure logical operator attains the minimum. The weight of counts the union of its supports, so this argument also includes errors.
Here is the correction proof for coherent errors, not only a classical decoding argument. Let be the code projector and let have bit-component weights at most and phase-component weights at most . If and , the corresponding components of have weights below . If this product anticommutes with a stabilizer , then , using . If it commutes with all stabilizers, the weight bounds force its two components into and , so its code compression is a scalar multiple of . Thus the Knill--Laflamme condition holds for the entire error family.
To see directly why this gives a common recovery, diagonalize its positive Gram matrix and form the corresponding error combinations . Their restrictions obey . For , is an isometry onto a syndrome subspace, and the different images are orthogonal. Measure these subspaces and apply the inverse isometry; zero- combinations annihilate the code. This recovers every quantum channel whose Kraus operators lie in the error span. Arbitrary operators supported on at most qubits expand in Pauli operators with the same support. Consequently the CSS code corrects all errors on up to qubits, and more generally the asymmetric family just described. The sufficient classical bound is obtained by replacing by the minimum distances of and , respectively; degeneracy can improve it.
Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 30 3 Solution Created 2026-10-03 Updated 2026-10-14
Use with . The given primitive polynomial over a finite field makes have order . For a binary cyclic code, squaring a zero preserves the zero condition: for . Thus the binary cyclotomic cosets modulo an odd integer governing the four specified zeros areThe two displayed orbits are disjoint, each has size five, and together contain . Therefore specifying and already forces all four consecutive defining zeros of a cyclic code.
The minimal polynomial of an algebraic element of is . For , the orbit size shows that its algebraic minimal polynomial has degree five. The candidate vanishes there, sinceFor example, the five-bit representations of these terms are , whose sum is zero in . As is a monic polynomial of degree five and annihilates , it is precisely its algebraic minimal polynomial; no assumption that the provided polynomial list is exhaustive is necessary.
The narrow-sense primitive BCH code isBoth algebraic minimal polynomials divide each such , and they are coprime polynomials. Their product is a divisor of . Hence the generator polynomial is their product. Direct multiplication with field characteristic two givesThe designed distance is five, because vanishes at the four consecutive powers .
Here is an explicit BCH bound proof for these zeros. If a nonzero codeword had support of a vector of size , with distinct positions and nonzero coefficients , put . Evaluating at the first defining powers givesThe coefficient matrix has determinant , a nonzero Vandermonde determinant because the are distinct and nonzero. It therefore forces every , a contradiction. Thus the minimum Hamming distance is at least five.
For the matching upper bound, multiplication gives the actual codewordwhich has Hamming weight five and degree below . HenceThis proves the actual distance without needing the optional theorem. Its numerical hypothesis is also satisfied: with and the error parameter , , whereas .
Now calculate the root-evaluation syndrome for a cyclic code from the received polynomial. Reduction modulo gives , so . Substitution followed by the same reduction gives , whose five-bit representation is . ThusThe single-error test from two binary BCH syndromes identifies coordinate , since a one-bit error has syndromes . Flip that coordinate to obtainBoth defining evaluations vanish: and . More directly,so it is certainly a codeword of . It is at Hamming distance one from . Since the minimum Hamming distance is five, no other codeword can be within two errors of : such a word would be at distance at most three from , contradicting the proved distance. Thus this is the unique bounded-distance decoding under the linear code's two-error guarantee.
The decoded polynomial printed in the original PDF is incorrect. It instead adds to , giving a polynomial . Its defining evaluations areTherefore it is not a codeword, and the request to verify that it belongs to is a false premise. The field table and the printed syndromes agree with correction at ; the correction at does not. The boxed corrected polynomial resolves this source error and supplies the intended decoding and membership proof.
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 36 4 Solution Created 2026-10-03 Updated 2026-10-14
A cyclic code of length over is a linear code invariant under . Associate the word with . The shift is multiplication by modulo , so shift-invariant linear subspaces are exactly the ideals of . The inverse image of such an ideal in is principal and contains ; hence it is generated by a unique monic divisor of . The code has basis , and dimension .
The defining zeros of a cyclic code are the roots of its generator in a splitting field. Since , each is a root of unity over a finite field. Every codeword vanishes at each such root. If the characteristic divides , root multiplicities must additionally be retained; in the Hamming construction below the modulus has no repeated roots.
The unrestricted ternary cyclic-equivalence assertion is false. At it would give a cyclic code. Butover , with the quadratic irreducible. A dimension-two cyclic code needs a degree-two generator, so its only possibilities are and . Each is a weight-two codeword. Therefore neither has minimum distance three, and no code equivalent to the ternary Hamming code can be cyclic. A valid general version of the asserted construction assumes odd . The usual distance-three Hamming parameters also require ; when the code is the length-one zero code.
Here is the construction with its precise qualification. A ternary Hamming code has a parity-check matrix whose columns represent each one-dimensional subspace of once. There are such subspaces. Its rank is , because the coordinate lines are included. Its minimum distance is at least three, because no column is zero and no two are proportional. For , two independent vectors and their sum determine three distinct columns, and, after adjusting their nonzero representative scalars, give a weight-three linear relation. Thus its parameters are . Permuting columns and changing their nonzero representatives produces a monomial equivalence of linear codes.
Take odd and choose of order . Since is odd, is not in the cyclic subgroup generated by . Hence lie in distinct one-dimensional -subspaces: a proportional pair would have ratio or , neither possible for two distinct powers in this list. By their number they represent all projective points. Consequentlyis monomially equivalent to the ternary Hamming code. Since , evaluation at descends to and its kernel is an ideal, so is cyclic.
The degree of over is . If it were , its generated field would have elements and its element order would givea contradiction. Its minimal polynomial of an algebraic element therefore has degree . Applying Frobenius to a polynomial relation shows that are its roots; they are distinct by the same field-degree argument. Their product polynomial is the monic minimal polynomial of an algebraic element, and it divides . ThusThis identifies all the defining zeros. For , , the defining exponents are modulo .
There is also a uniform construction for all , explaining the missing qualification. Let generate , which has order . The powers represent all projective points, since proportional powers differ by exponent or modulo . But , so the kernel of is an ideal modulo , a negacyclic code. Multiplication by gives , preserving its kernel. This code is always equivalent to the ternary Hamming code. If is odd, is odd too, and the substitution , or coordinate scaling , changes this negacyclic construction into the cyclic one. In fact then has order . These explicit constructions prove the qualified assertion rather than relying on a theorem name.
For decoding, use the printed matrix with received words as row vectors; the conventional parity-check matrix is . The received word's syndrome isA single-symbol error of value at position has syndrome , where is row of the printed matrix. HereTherefore subtract at the sixth coordinate, changing its received value to modulo three. The decoded codeword isIts syndrome is zero. The thirteen projective rows and the two nonzero scalars give all nonzero syndromes exactly once, so this is the unique codeword at distance one. It is the transmitted word under the usual assumption of at most one symbol error. If positions are designated check positions, their independent unit rows make the other ten symbols systematic data, namely .
Past exam of the mathematics course of the University of Cambridge 2004 iii Paper 32 1 Solution Created 2026-10-03 Updated 2026-10-14
Over a finite field , a linear code of length and dimension is a -dimensional subspace . A full-row-rank generator matrix gives , using row-vector messages. A full-row-rank parity-check matrix gives . The dual code is , of dimension . Thus the rows of span , andConversely the rank conditions and imply that the row space of equals the kernel of , by inclusion and equality of dimensions.
For a CSS code, specialize to binary linear codes , of dimensions . Define orthonormal encoded statesDifferent cosets have disjoint computational-basis support. Their span has dimension , so it encodes logical qubits. For binary vectors write and . The stabilizer generators are for a basis of , and for a basis of . They fix each encoded state: the former permute its coset terms and the latter contribute phases . Their commutation relation is , so the classical dual inclusion makes them commute. There are independent checks, giving precisely this encoded space.
For a Pauli error , the Z checks give bit-error syndrome , where checks , and the X checks give phase-error syndrome , where generates and hence checks . Classical decoders therefore correct up to bit flips and phase flips if and . A Y error has both components; it is not omitted from this correction scheme.
For the precise quantum code distance, harmless stabilizer errors must be excluded. A pure-X error preserves the code exactly when , and is a stabilizer when ; a pure-Z error preserves it when , and is a stabilizer when . Consequently, for ,A mixed Pauli error has weight equal to the size of the union of its X and Z supports. If it is a nontrivial logical operator, at least one component is nontrivial, so its weight is at least ; pure-X or pure-Z operators attain that minimum. Thus arbitrary-qubit errors are correctable: products of two such Pauli errors have weight below and act scalarly on the code, or take it to an orthogonal syndrome sector. This is the Knill--Laflamme condition. Expanding arbitrary errors in the Pauli basis extends correction to their coherent linear span.
An explicit example is the Steane code. Take to be the binary Hamming code withThe distinct nonzero columns show that has no weight-one or weight-two word, while three dependent columns give a weight-three word. Hence its classical distance is three. Direct multiplication gives , proving . Every nonzero word of has weight four, so the logical X and Z distances are both three. Its six stabilizer checks are the X and Z strings given by the three rows of . A logical basis is the uniform superposition over and over , since . The resulting CSS code corrects every single-qubit error.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 33 3 Solution Created 2026-10-03 Updated 2026-10-14
A binary block code of length is a nonempty subset . Its size is , the number of distinct codewords. The Hamming distance counts coordinates at which two words differ. The code's minimum Hamming distance is when there are at least two words. No pairwise minimum exists for a singleton code; it can be assigned as a convention when needed.
A binary linear code is a vector subspace of . If its dimension is , a generator matrix has a basis of as its rows, givingTo match the coordinate-row convention, take a parity-check matrix of size , with independent columns, and defineThe transpose is the usual parity-check matrix with one column per coordinate. By rank-nullity theorem, the displayed kernel has dimension . The two constructions agree when : the generator's row space lies in the parity-check kernel and has the same dimension, hence equals it. Conversely, for a given , choose the columns of as a basis of its dual code ; orthogonality and the dimension formula give exactly as the kernel.
For a nonzero linear code, is a nonzero codeword whenever are distinct codewords, and . Conversely compare any nonzero codeword with zero. Thus the minimum Hamming distance of a linear code is the least nonzero Hamming weight.
Write for the row associated with coordinate . A nonzero binary vector is a codeword exactly whenIts nonzero coordinate positions therefore index a linearly dependent set of rows. Conversely, a dependence among a set of rows has coefficients in , not all zero; putting these coefficients in the corresponding coordinates gives a nonzero codeword of weight no greater than the number of rows in that set. Taking minima in both directions proves the parity-check dependencies determine minimum distance criterion:Rows here are indexed by positions: equal row vectors at different positions are two distinct members of the indexed family. In the usual matrix convention, the same result refers to columns of . For the zero code, neither a nonzero codeword nor a dependent coordinate set exists, so both minima can consistently be interpreted as .
For the Hamming code, let , set , and let the rows of be all nonzero vectors of , each once. These rows include the standard basis, so has rank and the code has dimension and size . There is no dependence involving one row, because no row is zero, or two rows, because no rows are equal. For , any two distinct nonzero vectors have a distinct nonzero sum , which is another row. These three rows sum to zero. Thus for .
The perfectness of a Hamming code also has a direct decoding proof. Given any received word , its syndrome is . A zero syndrome means . Otherwise it equals exactly one row . The vector then has syndrome zero and is the unique codeword obtainable by changing one coordinate. There is no other codeword at distance at most one: its necessary correction would have to have the same syndrome, and among zero and all single-coordinate errors the syndromes are precisely the distinct vectors of . Therefore the radius-one Hamming balls about codewords partition .
Equivalently, each ball contains words; disjointness and show that none are uncovered. Hence every nondegenerate binary Hamming code is a perfect single-error-correcting code. For , the construction is the singleton code , whose one radius-one ball is also the whole ambient space. This deals with the degenerate boundary without falsely claiming its minimum distance is three.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 37 5 b Solution Created 2026-10-03 Updated 2026-10-14
Let , and write for any odd-weight word . The parity functional on the four-dimensional binary linear code is nonzero, so its kernel has dimension three and its other fibre is the coset . For example belongs to the standard length-seven Hamming code and has odd Hamming weight. Denote the two logical basis states by and , corresponding to these two cosets. The eight computational orthonormal basis vectors in each sum are distinct, so both logical states have norm one; their disjoint supports make them orthogonal.
For a binary vector , define the product of Pauli Z gateswhere the dot product is computed modulo two. The key diagonal overlap, with and , isIf , every summand is one. If , choose with . Translation permutes and negates every summand. The sum must then be zero. ThusOff-diagonal logical overlaps vanish for every :because a diagonal Pauli operator cannot move a computational basis word from one coset to the disjoint other coset.
The possible errors are and for . Set . Each phase flip is its own adjoint and inverse, soIf , the vector is nonzero and has Hamming weight one or two. By the given dual code identity and the minimum Hamming distance three of the Hamming code, it cannot belong to . Hence all its diagonal logical overlaps vanish. If , the product is the identity and its logical overlaps are . Combining both cases givesThis proves the Knill--Laflamme condition with an identity error-overlap matrix, not merely a possibly degenerate scalar matrix. In particular the eight two-dimensional error subspaces are mutually orthogonal. This is precisely nondegenerate phase-flip correction in the Steane code.
To exhibit recovery rather than only the criterion, let be the orthogonal projector onto the code and . The projective measurement consisting of these eight mutually orthogonal projectors, completed by , determines which error occurred. For an arbitrary encoded pure state affected by , outcome occurs with certainty and leaves unchanged. Applying again recovers . The outcome gives the error syndrome and does not reveal or , so recovery preserves logical quantum superpositions.
An equivalent explicit error syndrome uses three commuting X-type stabilizer generators. Choose a parity-check matrix for with the seven different nonzero binary columns:Its rows span . For a row , the operator permutes each of and , and therefore has eigenvalue on both logical states. A phase flip at position changes its eigenvalue to , since . Measuring the three commuting stabilizer generators gives the th column of as a binary syndrome; no error gives the zero column. All eight outcomes are different, and applying the identified restores the code state. Measuring these stabilizer generators never distinguishes the two logical states.
Finally, if a noise Kraus operator is a coherent linear combination , the same syndrome measurement separates its mutually orthogonal components . Conditional recovery returns in every nonzero branch. Linearity then also corrects any quantum channel whose Kraus operators lie in this span. The argument therefore corrects arbitrary unknown single-site phase flips nondegenerately, including coherent phase-error amplitudes, rather than only a known error on a basis codeword.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 87 1 Solution Created 2026-10-03 Updated 2026-10-14
Work over the finite field , and write for row of the PDF's matrix. The first row has Hamming weight eleven; all other rows have Hamming weight seven. To check their intersections economically, index the last eleven columns modulo eleven. The last eleven rows, after deleting the first column, are the successive cyclic shifts of the set . Direct calculation givesThe intersection sizes for equal those for . Thus two different rows among meet in four positions, including their shared first coordinate, whereas meets each of these rows in six positions. All these intersection sizes are even numbers, while each row weight is an odd number. Consequently . The first row and column agree, and the entry of the last eleven-by-eleven block depends only on the sum of its row and column indices modulo eleven, because successive rows are left shifts. Thus is a symmetric matrix, so .
The generator matrix has rank twelve, andHence its linear code lies in its dual code . Both have dimension twelve, so : it is a self-dual code. Moreover , and is an invertible matrix, so this is another generator matrix for the same code. In the column parity-check matrix convention of the question,The matrix has rank twelve, so its nullspace condition characterizes exactly.
To prove the minimum Hamming distance, first observe that the rows of have Hamming weights twelve and eight. For binary vectors,Every partial sum of generator rows is orthogonal to every further generator row, by . Its intersection with that row therefore contains an even number of positions. Induction using this identity proves that every codeword has weight divisible by four: is a doubly even code.
The systematic-matrix proof of extended Golay distance now excludes weight four. Write a codeword as and put . If its total weight were four, . For , the right half is a row of and has weight seven or eleven. For , the right half is the sum of two distinct rows; the intersection counts above give weight or . For , the right half would be a unit vector, but then would be a row of , of weight seven or eleven. For , the right half would vanish, contradicting invertibility of . Thus no nonzero word has weight four. Every nonzero weight is consequently at least eight, and any generator row other than the first attains eight. Since the minimum Hamming distance of a linear code is its least nonzero weight,
Define the length- binary Golay code as the punctured code obtained by deleting the first coordinate of this extended binary Golay code. This puncturing is injective on , because a nonzero word in its kernel would have weight one. Thus , and deleting one coordinate gives . The sum of the first two generator rows has weight eight and first coordinate one, so its puncture has weight seven. Therefore . In fact any coordinate can be punctured: every left coordinate except the first occurs in a weight-eight generator row, the first occurs in the sum just used, and every right coordinate occurs in at least one of the weight-eight generator rows.
The radius-three Hamming balls around the words of are disjoint, since two centers in intersecting balls would have Hamming distance at most six. Each ball containswords. Their combined size is , the size of the entire binary Hamming space. Hence
For decoding in , write the received word as , where is the unknown error in its two halves. Its syndrome isLet denote the length-twelve unit vector. For bounded-distance decoding, the three-error syndrome decoding of extended Golay code is the following finite search, returning the first successful candidate error:
Every returned candidate has total Hamming weight at most three and the required syndrome. Conversely, an error of total weight at most three has a half of weight zero or one. The tests exhaust respectively , , , and , so they find every such error. Two distinct successful candidates would differ by a nonzero codeword of weight at most six, contradicting . Thus the result is unique, and the decoded word is . The condition still allows the first test when the weight is exactly three; for larger syndrome weight begin with the second test. A large syndrome weight alone does not imply more than three errors.
The decoder corrects every error of weight at most three; failure means that the received word is outside all radius-three decoding balls. Unlike its puncture, is not a perfect code: its radius-three balls cover only words. Without the three-error assumption, a successful test identifies a nearby codeword but need not identify the transmitted word.
For an arbitrary received word, a complete minimum-distance decoding fallback is to enumerate and minimize . Every error with the observed syndrome has exactly the form , so a minimizer gives a nearest codeword . Report all minimizers if there is a tie. This also decodes outside the guaranteed radius in the nearest-word sense, while making no unsupported claim that the transmitted word is determined. Thus a syndrome of weight at least three alone is insufficient for guaranteed recovery; either the three-error hypothesis or a choice among nearest words is needed.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 87 3 Solution Created 2026-10-03 Updated 2026-10-14
For distinct evaluation points and , the Reed-Solomon code isThis is a linear code of dimension : evaluation is linear, and a nonzero polynomial of degree less than cannot vanish at all distinct points. The assertion of cyclicity concerns the primitive, unextended construction: set and , where generates the multiplicative group of a finite field . Arbitrary evaluation sets or arbitrary coordinate orders need not make a Reed-Solomon code a cyclic code.
For this ordered full-length construction, shifting the evaluation vector to the right gives . This is the evaluation vector of , whose degree is still less than , so it is a cyclic code. Its generator polynomial follows from the finite geometric seriesHere the scalar is nonzero in . Write and . For ,since . Thus every word is divisible by . This monic divisor of generates a cyclic code of dimension , equal to the evaluation code by inclusion and dimension. Hence
It is useful to allow a starting exponent for the consecutive zeros of a cyclic code. Define the primitive cyclic Reed-Solomon codeAll exponents are understood modulo . The same geometric-sum calculation shows thatIndeed evaluating its word polynomial at , , gives sums with exponents between one and . This is a generalized Reed-Solomon code, with nonzero coordinate multipliers ; is the unweighted evaluation code. Directly, a right shift corresponds to replacing by , so these offset codes are also cyclic codes.
A maximum distance separable code, or MDS code, is a linear code attaining the Singleton bound, with . To see the bound, deleting any coordinates is injective on a code of minimum Hamming distance , since two words with the same puncture would differ in at most positions. Therefore and . For a nonzero Reed-Solomon evaluation word, the polynomial has at most distinct polynomial roots, so at least coordinates are nonzero. Nonzero coordinate multipliers do not change these zero positions. This proves for both Reed-Solomon codes and generalized Reed-Solomon codes. Equality can also be exhibited: choose any evaluation points and take their linear factors as ; it vanishes exactly at those points and has weight . Thus
The duality of primitive cyclic Reed-Solomon codes is especially transparent in the evaluation form. Assume first . A vector of has coordinates , ; a vector of has coordinates , . Their standard dot product isEvery monomial in has exponent at least one and at most , and every such power sum vanishes. Thus . Both sides have dimension , givingIn particular has generator . This agrees with the general dual of a cyclic code rule: invert the roots belonging to the complementary factor . The dual is a Reed-Solomon code in the consecutive-zero convention. With the strictly unweighted evaluation definition, its coordinates instead have the form , so it is a generalized Reed-Solomon code; it need not equal the unweighted code of dimension on the same points. This convention distinction is essential. The case is the full word space and its dual is the zero code, obtained by taking .
For code encoding, use the finite-field discrete Fourier transform and its inverse:For a message , put for , and set all other transform coordinates to zero. The inverse discrete Fourier transform returnsThe zero transform coordinates are precisely the root checks defining . This gives non-systematic encoding by evaluation. For systematic polynomial encoding of a cyclic code with a message polynomial of degree less than , put and calculate the remainder of upon division by . Then is divisible by , and the last coefficients are the message coefficients. Both methods use the same generator polynomial and the same ordered powers of .
For bounded-distance decoding, let , put , and assume at most symbol errors. The following description uses the Reed-Solomon key equation and fixes the transform and locator conventions explicitly.
- Compute the syndromes for . The corresponding codeword transform values vanish. An error of value at coordinate contributes , where , so .
- Form . Use the Berlekamp-Massey algorithm, or the polynomial extended Euclidean algorithm applied to and , to solve with , , and . Choose the minimal-degree locator; zero syndrome gives , . The error locator polynomial is , and is the error evaluator polynomial.
- Perform a Chien search: test for . Its distinct zeros identify the erroneous coordinates. A mismatch between the degree and the number of distinct permitted roots is a decoding failure.
- Recover each error value by the Forney algorithm, with the present syndrome offset:
- Set , all other error coordinates to zero, and output . Verify that all root checks vanish and that the correction has weight at most . Recover the message from the unconstrained transform coordinates by , or from the last coefficients if systematic encoding was used.
The denominator in the Forney algorithm is nonzero for distinct locations. The minimum-distance error-detection and correction guarantee gives unique recovery because . If the required locator or a valid correction cannot be found, declare decoding failure. Beyond errors, a received word may lie near a different codeword, so successful root checks alone do not certify recovery of the originally transmitted message. The guaranteed correction radius is symbol errors.
Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 31 4 Solution Created 2026-10-03 Updated 2026-10-14
Use binary codes, so the polynomial modulus is in . A cyclic code is a linear subspace of invariant under the cyclic shift . Identify a word with . Addition is coefficientwise, and multiplication is polynomial multiplication reduced modulo . In the quotient ringmultiplication by is exactly that cyclic shift. Closure under this map and linear combinations gives closure under multiplication by every polynomial, so a cyclic code is an ideal of . Conversely, an ideal is a linear subspace closed under multiplication by , proving the correspondence.
Take the inverse image of in . This is an ideal containing . The polynomial division algorithm shows directly that it has a unique monic generator : choose a nonzero polynomial of least polynomial degree and divide any other member by it; the remainder is in the ideal and has smaller polynomial degree, so must vanish. If two monic generators existed, mutual divisibility would make them equal. Because belongs to the ideal, . Conversely every monic divisor of defines an ideal of . Thus the generator polynomial of a cyclic code satisfiesFor a nonzero code, is its nonzero polynomial representative of least polynomial degree. For the zero code, use , whose residue in is zero; this standard convention covers that endpoint despite its having no nonzero codeword.
Let and , and put . Every codeword has a unique representation with : dividing an arbitrary multiplier by does not change its product with modulo . The words have distinct leading degrees below and are independent. ConsequentlyThe statement remains valid for the zero code, with an empty basis, and the full code, with .
For length 16, characteristic two gives . Its only monic divisors are for . Hence all binary cyclic codes of length a power of two in this case areThere are exactly 17 codes, forming the chain . This is a repeated-root cyclic code situation, so it would be incorrect to count just square-free factors. Their canonical check polynomials of a cyclic code are . An explicit expansion of each generator is .
The canonical check polynomial of a cyclic code isIndeed means . Since , cancellation in the polynomial ring gives , exactly code membership. No coprimality of and is needed, including for length 16.
There is a normalization qualification in the printed definition. The kernel condition alone does not force the supplied polynomial to equal this canonical . If , write and with . Then holds exactly when , so its kernel is the ideal generated by . ThereforeEquivalently with . Requiring the monic divisor of selects the canonical check polynomial of a cyclic code. For example gives the same kernel as , since is a unit modulo , but is generally a different polynomial. Given any permitted , taking recovers the canonical .
To construct a parity-check matrix, write the canonical and its reciprocal polynomial . Take coefficient vectors, padded to length , ofas the rows of . Here because , so these rows have successive leading degrees and are independent. For a word , row has dot product , the coefficient of in the ordinary product . If , then with . This product has no terms in degrees , so . The kernel of has dimension , the same as , proving . This proves the reciprocal-polynomial parity-check matrix construction and identifies its rows as a basis for the dual of a cyclic code.
Alternatively, a supplied check polynomial of a cyclic code reduced modulo , , gives the polynomial multiplication parity-check matrixThis circulant matrix represents multiplication by modulo , so its kernel is and its matrix rank is . Selecting independent rows yields a rank- parity-check matrix even without initially normalizing the supplied polynomial.
The syndrome labels the coset . Indeed if and only if , equivalently . There are cosets, each with words, and the syndrome classification of code cosets gives a bijection between them and . If is a transmitted codeword plus an error, then : the syndrome determines the error coset. Choosing a minimum-weight coset leader and subtracting it performs minimum-distance decoding. The error itself need not be uniquely identified, but it is unique when its weight is at most , since the corresponding error-correction balls are disjoint.
For the repetition code, the nonzero codeword is the all-ones word, soTheir product is , and the generator polynomial degree gives dimension one. For the single parity-check code, membership is , equivalent to divisibility by . ThusIts dimension is ; it is the even-weight code.
Finally, factor the binary length-seven modulus:A standard cyclic realization of the Hamming code of length seven usesIts dimension is four. The reciprocal-check construction givesIts columns are exactly the seven distinct nonzero vectors of , so no word of weight one or two is in its kernel. The generator itself has weight three, so the minimum Hamming distance is exactly three; this is the Hamming code. Reversing the cyclic coordinate order gives the equally valid reciprocal choiceThe polynomial answer therefore depends on the cyclic coordinate convention, while the resulting codes are equivalent.
Past exam of the mathematics course of the University of Cambridge 2007 ii Paper 3 4G Solution Created 2026-09-24 Updated 2026-10-14
The polynomials are over , and multiplication gives . A cyclic code of length seven generated by a degree-three polynomial has dimension : the multiples with are distinct representatives, so its rank is four.
The root has order seven in : it is neither zero nor one, and the multiplicative group has prime order seven. A weight-one word cannot vanish at . A weight-two word , with distinct indices between zero and six, cannot vanish either, because that would give . Every codeword vanishes at , so its nonzero weight is at least three. Since itself has weight three,From obtain and . Therefore . The one-bit error has precisely this syndrome, so correcting it givesIts distance from the received word is one. The minimum distance three makes this nearest codeword unique: two codewords each at distance one from the received word would be at distance at most two from each other.
Past exam of the mathematics course of the University of Cambridge 2008 ii Paper 3 4G Solution Created 2026-09-24 Updated 2026-10-14
One choice of the Hamming code of length seven is the linear mapover . Its image is the kernel of the parity-check matrixIndeed , the encoder is injective because positions recover its inputs, and has rank three. Its columns are nonzero and pairwise distinct. Hence no nonzero codeword has Hamming weight one or two. The word has weight three, proving that the minimum Hamming distance is three.
If is received with one erroneous bit, its syndrome is column of . These seven columns are distinct, so the syndrome identifies the bit to flip. A zero syndrome indicates no error under the assumption of at most one error.
For the extended Hamming code, append . Every extended codeword has even weight. Since every original nonzero word has weight at least three, its extended weight is at least four; the weight-three example attains four. ThusThe minimum-distance error-detection and correction guarantee gives detection of up to three errors and correction of one error. Detection here means rejecting a word outside the code, rather than simultaneously identifying and correcting every detected pattern; the usual combined decoder corrects single errors and flags double errors.
Past exam of the mathematics course of the University of Cambridge 2009 ii Paper 3 4H Solution Created 2026-09-24 Updated 2026-10-14
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.
Past exam of the mathematics course of the University of Cambridge 2010 ii Paper 2 4H Solution Created 2026-09-24 Updated 2026-10-14
Take the parity-check matrixover . Its columns are all the nonzero vectors of . The Hamming code is . Since has rank three, is a binary linear code of length seven and dimension four. No nonzero codeword has weight one or two, since no column is zero and no two columns coincide. Columns give a codeword of weight three, so has parameters .
For a received vector , its syndrome is . A single error in position gives exactly column of , so the syndrome identifies that position uniquely; zero syndrome means no error under the one-error assumption. The radius-one Hamming balls around the codewords are disjoint and have total size , so this is also a perfect code.
There are weight-three codewords: every pair of columns determines the third, and each triple is counted three times. The all-ones vector is a codeword because the column sum is zero, so complementation gives seven weight-four codewords. Together with zero and the all-ones vector these account for all sixteen. The weight enumerator is therefore
Past exam of the mathematics course of the University of Cambridge 2015 ii Paper 1 9G Solution 2026-10-06
For , let be the binary matrix whose columns are all distinct nonzero vectors of . The binary Hamming code is . Its parity-check matrix has rank since its columns include the standard basis. Hence is linear of length and dimension .
No word of weight one or two lies in , since columns are nonzero and distinct; three columns sum to zero, so the minimum distance of a code is exactly three. The syndrome of a single-bit error is its column of , uniquely identifying the erroneous position. The possible syndromes correspond to no error or exactly one of single-bit errors. Alternatively, every radius-one Hamming ball has words andDisjoint balls therefore cover the whole word space. This proves linearity, one-error correction and perfection. For , the parameters are , giving the 16 messages needed below.
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 2 3G Solution Created 2026-09-24 Updated 2026-10-03
Let and let be the parity-check matrix whose columns are the distinct nonzero vectors of the finite field vector space . The binary Hamming code isA perfect code has Hamming balls of radius about its codewords partitioning the whole ambient space, where is its minimum Hamming distance of a linear code.
No column of is zero and no two columns agree, so has no word of Hamming weight one or two. Three suitable columns sum to zero, so . For any received word , its syndrome is either zero or is the unique column of equal to that syndrome. In the first case ; in the second,so is at Hamming distance one from a codeword. Uniqueness follows from . Thus the radius-one balls partition , and the code is perfect.
For , the dual code is the binary simplex code of length seven. Every nonzero dual word evaluates a nonzero linear functional on the seven nonzero vectors of , and exactly four of those evaluations are one. Hence every nonzero word of has weight
Reed-Solomon key equation 2026-10-14
With syndromes and distinct error-location values , form and the error locator polynomial . There is an error evaluator polynomial of degree less than the number of errors satisfying the key equation. When the number of errors is at most , the Berlekamp-Massey algorithm or extended Euclidean algorithm recovers these polynomials, normalized by .