Concept

Error-correcting code

A chosen set of words far enough apart that a corrupted one can be repaired to the nearest. How many errors it can repair is decided by its minimum distance, which is the smallest disagreement between two of its words.

Named by 19 essays across 2 fields — each of them below, with the objects they name alongside it.

A code on the 3-cube, and the balls around its words. The corners of a hypercube with the chosen codewords marked and the words within one error of each shaded.

Distance is a picture

A message is a corner of a cube and an error is a step along an edge. Everything a code can do is decided by how far apart the corners it uses are — and that is a fact about a drawing.

computation · Error-correcting codes
The sixteen words of the [7,4] Hamming code. A table of sixteen seven-bit codewords with their data bits, parity bits and weights.

Sixteen spheres that fill a cube

A hundred and twenty-eight seven-bit words, sixteen of them chosen, and a ball of eight around each. Sixteen times eight is a hundred and twenty-eight exactly — so the balls tile the space with nothing left over, and the code wastes nothing at all.

computation · Error-correcting codes
The syndrome of 1011010, and the bit it names. A parity-check matrix over a received word, with the resulting syndrome matched against the table of single-error syndromes.

Finding the error without reading the message

Three parity checks on a seven-bit word produce three bits. If they are all zero nothing is wrong; otherwise they are the number of the position that broke. The message is never consulted, because the answer does not depend on it.

computation · Error-correcting codes
A degree-2 polynomial over GF(11), and the 7 values sent. A grid of the finite field with the polynomial's value at each point marked, and the transmitted symbols picked out.

A polynomial through the gaps

Write the message as the coefficients of a polynomial and send its values instead. Any k of them determine the polynomial, so it does not matter which ones are lost — and it does not matter how many, as long as k survive.

computation · Error-correcting codes
A four-by-four array holding every two-by-two block. A binary array, cyclic in both directions, drawn with its wrapped row and column, in which each of the sixteen two-by-two blocks appears exactly once.

A page that knows where it is

A four-by-four array of bits, cyclic in both directions, in which every two-by-two block appears exactly once. Print it repeatedly across a sheet and any four marks on that sheet are an address.

computation · De bruijn
The largest code at each length, distance 3, against four bounds. A table with one row per word length, giving the exact size of the largest code of that length at the stated minimum distance and the values of the Singleton, Hamming, Plotkin and Gilbert-Varshamov bounds.

The best a code can be

A code is a set of words chosen far apart, and every construction answers "here is one" rather than "here is the best". The best can be computed at small lengths, and putting four classical bounds beside the exact answer shows which of them is doing the work and where none of them is.

computation · Error-correcting codes
How many codewords lie within each radius, for a [7,3] code over 11 symbols. A bar for each decoding radius, its height the largest number of codewords found inside a ball of that radius around a randomly drawn received word, with the unique-decoding radius and the Johnson radius marked.

Past half the distance

A code of minimum distance five corrects two errors, and every account stops there. Two is the largest number for which the answer is unique — and a decoder that returns a short list instead of one answer reaches considerably further, which can be measured by counting the codewords in a ball.

computation · Error-correcting codes
Channel capacity 1 − H(p), and three codes at p = 0.1. The capacity of the binary symmetric channel plotted against its flip probability, with the rates of repetition, the Hamming code and no coding marked at one flip probability.

The rate a noisy channel allows

A channel that flips one bit in ten can still carry messages with as few errors as anyone likes — at up to 0.531 message bits per transmitted bit, and at no rate above that. The number is Shannon's capacity, 1 − H(p). Repetition reaches reliability only by sending nothing; a code chosen at random gets there at any rate below the limit; and the reason there is a limit at all is a count of how many flip patterns a block of noise can hold.

computation · Error-correcting codes
Decoding from 20 + m random combinations: the chance it works. Bars for the exact probability that 20 plus m random binary combinations of 20 message bits have full rank, with simulated frequencies as dots, for m from zero upwards.

Erasures a code can see

If a channel loses bits instead of flipping them, and says which ones it lost, its limit rises from 1 − H(p) to 1 − p — and reaching it needs nothing cleverer than a random matrix and the solution of simultaneous equations. A random code needs, on average, 1.607 symbols more than the message it carries, whatever the message's length, and that number is a constant Erdős proved irrational.

computation · Error-correcting codes
3 orthogonal squares of order 4, read as a code. A table of 16 words of length 5 over 4 symbols, one per cell of 3 orthogonal Latin squares of order 4: row, column and the entry in each square. Any two words agree in at most one position.

Orthogonal squares are a code

Write down each cell of a set of orthogonal Latin squares as a word — its row, its column, and its entry in each square — and no two words agree in more than one place. That is not a pleasant accident of the squares. It is exactly what being Latin and being orthogonal say, it makes the list an error-correcting code as good as any code of its size can be, and the squares a field builds turn out to be a Reed–Solomon code, the one on every compact disc.

computation · Latin squares
The same two lengths at 3 angles, and the area largest at the right angle. Parallelograms spanned by columns of lengths 1.6 and 1.25 at angles 38, 90, 142 degrees. Their areas are 1.23, 2.00, 1.23; the bound 2.00 is the product of the lengths and is reached only when the columns are perpendicular.

The biggest box built from signs

Fill a square table with plus and minus ones and ask how large its determinant can be. The columns all have the same length, so the answer is a box with fixed edges — largest when every corner is square, which is possible only when the size is a multiple of four.

algebra · Determinant
The longest code that survives every erasure pattern, by field and dimension. q 2, k 2: 3; q 2, k 3: 4; q 3, k 2: 4; q 3, k 3: 4; q 3, k 4: 5; q 4, k 2: 5; q 4, k 3: 6; q 4, k 4: 5; q 4, k 5: 6; q 5, k 2: 6; q 5, k 3: 6; q 5, k 4: 6; q 5, k 5: 6; q 5, k 6: 7; q 7, k 2: 8; q 7, k 3: 8; q 7, k 4: 8; q 7, k 5: 8; q 7, k 6: 8; q 8, k 2: 9; q 8, k 3: 10; q 8, k 4: 9; q 8, k 5: 9; q 8, k 6: 9; q 9, k 2: 10; q 9, k 3: 10; q 9, k 4: 10.

The longest code that survives every erasure

A Reed–Solomon code of k symbols can lose any n − k of its n and still be read. Over an alphabet of q symbols it can be at most q + 1 long — and it is conjectured that no code with the same perfect tolerance can ever be longer, apart from one family of exceptions in even characteristic. A search through every possible code for small alphabets confirms it cell by cell, a proof exists when q is prime, and for every other q the question is open.

computation · Error-correcting codes
No pair of weights modulo ten catches everything. Two 10 × 10 grids over pairs of alternating weights modulo ten, shaded by the share of single errors and of swaps each catches. No pair is full in both; weights 3 and 1, ringed, catch every single error and 88.9% of swaps.

Ten digits need a symmetry that does not commute

A check digit should catch one wrong digit and two neighbours swapped. Over eleven symbols a weighted sum does both; over the ten decimal digits no weighted sum can, no scheme of any shape built on adding modulo ten can, and the reason is the same as the reason Euler's thirty-six officers cannot be paraded. What works is the ten symmetries of a pentagon, which do not commute.

computation · Error-correcting codes
The Golay code drawn from an icosahedron. generator rows f19001 e72002 eac004 47d008 8bb010 33e020 bca040 7d4080 de1100 2e7200 58f400 957800; weight distribution 0:1 8:759 12:2576 16:759 24:1.

A code built from an icosahedron

Write down which corners of an icosahedron are not joined by an edge, put the table beside a diagonal of ones, and add the twelve rows together in every combination. The 4,096 strings of 24 bits that come out differ from each other in at least eight places, occur in only five weights, and — with one bit deleted — fill the space of 23-bit strings so exactly that every one of the 8,388,608 lies within three flips of exactly one of them. This is the Golay code, which carried Voyager's pictures home, and its words of weight eight cover every five of the twenty-four positions exactly once.

computation · Error-correcting codes
A word that survives losing any one of its bits. codeword 100110010110, a=0 mod 13; deletions at 1..12 all decoded.

A code that survives a lost bit

A flipped bit leaves the word the right length and wrong in one place; a lost bit leaves it one short, with no sign of where the gap was. Keep only the words whose 1s sit at positions adding up to a multiple of n + 1, and any single lost bit can be put back. The price is about log₂(n + 1) bits, the same as the Hamming code pays for a flip.

computation · Error-correcting codes
How many words can survive two lost bits. Two-deletion-correcting code sizes by length: n=4: optimum 2, greedy 2, Helberg 2; n=5: optimum 2, greedy 2, Helberg 2; n=6: optimum 4, greedy 4, Helberg 3; n=7: optimum 5, greedy 5, Helberg 4; n=8: optimum 7, greedy 6, Helberg 5; n=9: optimum 11, greedy 9, Helberg 6; n=10: optimum -, greedy 13, Helberg 8; n=11: optimum -, greedy 20, Helberg 9; n=12: optimum -, greedy 29, Helberg 11; n=13: optimum -, greedy 46, Helberg 15.

Two lost bits

One congruence repairs any single lost bit, and the set of words it defines is believed to be the best possible. Two lost bits defeat it. An exhaustive search finds the largest codes that survive two — 2, 2, 4, 5, 7 and 11 words for lengths 4 to 9 — and Helberg's congruence, with weights that grow like Fibonacci numbers, gives a code that provably works at every length but spends a fixed share of every bit on protection. The best codes need only about four times the logarithm of the length.

computation · Error-correcting codes
Three distances fix a word of three bits. The cube of three-bit words with landmarks 000, 001, 010; each word labelled by its Hamming distances to them; all eight lists differ.

How few distances fix a word

An unknown word of a thousand bits can be read one bit at a time with a thousand questions. Ask instead for its distance from a chosen word, and each answer is worth about half of log₂ n bits, so roughly two hundred distances fix it. A balance reading many coins at once is the same question. So is Mastermind, in which Knuth's rule finds any of the 1,296 codes in at most five guesses and a mean of 4.476, and no first guess is best on both counts.

computation · Error-correcting codes
A secret on a curve in a finite field. The quadratic 17 + 9x + 4x² modulo 31: shares q(1) = 30, q(2) = 20, q(3) = 18, q(4) = 24, q(5) = 7, q(6) = 29, q(7) = 28, q(8) = 4; the secret is q(0) = 17.

Two shares know nothing

Hide a number as the constant term of a quadratic modulo a prime and give eight people one value each. Any three can recover it. Any two know exactly nothing: of the 2,197 quadratics modulo 13, those matching two shares split into exactly one for each possible secret. Over the whole numbers the same two shares already give away the secret's parity.

computation · Finite fields
A code made of the flats of a space. All 32 words of the Reed–Muller code RM(1, 4), each drawn on the sixteen points of the affine space of four dimensions over two elements: one word of weight 0, one of weight 16 and thirty of weight 8.

Parallel planes take a vote

Draw a four-dimensional space with two values to a coordinate as a 4 × 4 grid, and mark its hyperplanes: thirty-two patterns any two of which differ on eight of sixteen squares. A polynomial's top coefficient can be read off any plane, and parallel planes do not overlap, so an error spoils only one vote. One of them flew to Mars, and in 2016 it turned out to reach Shannon's limit.

computation · Finite geometry

Named alongside it

The objects these essays reach for when they reach for this one.

Exhaustive searchHamming distanceFinite fieldHamming codeBoundChannel capacityErasureMinimum distanceModular arithmeticPerfect codePolynomialRedundancy

All concepts