A polynomial through the gaps
Worth reading first: Finding the error without reading the message.
Two points determine a line. Three determine a parabola. That fact, taken seriously and done over a finite alphabet, is a code.
The construction
Fix a finite field — here the integers modulo , which is a field because is prime, so every non-zero remainder has a reciprocal.
Take the message to be symbols from that field, and read them as the coefficients of a polynomial of degree less than . Choose distinct points of the field, with , and send the values
That is the whole encoder. The figure above does it with , and : the message becomes , and the seven values sent are .
Why any of them are enough
A polynomial of degree less than is determined by its values at any distinct points. There are two ways to see it and both matter.
By interpolation. Lagrange’s formula writes the polynomial down explicitly from points, as a sum of terms each of which is at one point and at the others. Every step is field arithmetic — subtractions and one division — so the formula works over the integers mod exactly as it does over the reals.
By counting roots. If two polynomials of degree less than agreed at points, their difference would be a polynomial of degree less than with roots, and a non-zero polynomial cannot have more roots than its degree. So the difference is zero.
The second argument is the one that generalises, and it is worth noticing that it needs the alphabet to be a field. Over the integers modulo — not a field, because times leaves no remainder — the polynomial has two roots, and , and the whole argument collapses. That is the reason a finite field is required rather than merely a finite set with arithmetic on it.
Erasures, which are the easy failure
The channel model changes here, and the change is what makes the code so clean.
A flip turns a symbol into a different symbol without saying so. An erasure removes a symbol and says which one is missing — a disc sector that fails to read, a packet that never arrives, a scratch whose position is known.
Erasures are much easier, because the positions of the survivors are known and any of them suffice.
The two figures make the point that no single one could. It is not that this code tolerates these four erasures; it tolerates any four, and the figures show two disjoint choices working identically. The generator checks all ways of choosing which three survive, on every placement, and requires the recovered coefficients to be the ones sent.
Where the boundary is
One symbol fewer and everything stops, which is worth showing because a boundary that is not exhibited is a boundary the reader has to take on trust.
With only survivors, the number of messages consistent with them is exactly — one for each value the missing constraint could take. The figures compute that count directly by trying all possible messages and keeping the ones that agree with the survivors, and the answer is .
So the code is not merely good at erasures; it is precisely at the edge. Recovery is certain up to losses and impossible at , with no grey region between.
Interpolation, done exactly
It is worth watching one recovery in full, because “interpolate” is a word that hides whether anything difficult is happening, and here nothing is.
Suppose the surviving points are , and , over the integers mod . Lagrange’s basis polynomial for the first point is
and dividing by mod means multiplying by the reciprocal of , which is because . So the division is a multiplication and there is no rounding anywhere.
Building all three basis polynomials, scaling each by its point’s value and adding gives , which is the message. Every operation was an addition, a multiplication or a lookup of a reciprocal in a table of ten entries.
That exactness is the difference between this and interpolation over the real numbers, where fitting a high-degree polynomial to data is famously unstable and small changes in the values move the curve wildly. There is no stability question here because there is no notion of small. Two field elements are equal or they are not, and the recovered polynomial is right or it is not.
Distance, measured over every codeword
For flips rather than erasures the relevant quantity is the minimum distance, and it can be read off the same root-counting argument.
A non-zero message gives a non-zero polynomial of degree less than , which has at most roots, so at most of the transmitted values are zero and at least are not. Since the code is linear, that minimum weight is the minimum distance.
The Singleton bound says no code can do better: a code of length with codewords and distance satisfies , because deleting symbols from every codeword must still leave them all distinct, and there are only shortened words to be distinct in.
Codes meeting it are called maximum distance separable, and they are rare. These are them. The distance is exactly, at every length and every dimension, over any field big enough to supply distinct points.
The bound’s proof is worth one more look because it is a clean piece of counting of the kind this collection keeps returning to. Delete the first symbols from every codeword. Two codewords that agreed on everything remaining would differ in at most places, contradicting the minimum distance — so the shortened words are still all distinct. There are possible shortened words, so there were at most that many codewords to begin with. No construction, no algebra, and it applies to every code there is.
What that costs
Nothing is free, and the cost here is the alphabet.
The construction needs distinct evaluation points, so : the codeword cannot be longer than the field. Correcting a lot of errors in a long message therefore means a large field, and a large field means symbols carrying many bits each.
In practice the field is and a symbol is a byte. The standard code on a compact disc is over that field; the one on a QR code is with chosen by the error-correction level; the one on the Voyager missions after Jupiter was , correcting sixteen bad bytes in every two hundred and fifty-five.
That byte-sized alphabet is also the answer to the burst problem of the previous rung. Eight consecutive bad bits inside one byte are one wrong symbol, not eight wrong bits, so a code that corrects sixteen symbol errors survives a scratch a hundred and twenty-eight bits long. Choosing the alphabet to match the shape of the damage is most of the engineering.
For flips the accounting differs from erasures by exactly a factor of two, and the reason is worth stating.
An erasure is a known position and an unknown value: one unknown. A flip is an unknown position and an unknown value: two unknowns. So redundant symbols buy erasures or flips, and a decoder can trade between them — correcting erasures and flips whenever .
That relationship is why systems that can detect where the damage is do so. A disc controller knows which sector failed; a packet network knows which packet is missing. Turning a flip into an erasure by other means doubles the value of the same redundancy, and it is often much cheaper than adding redundancy.
Finding the errors, which is the hard half
Everything above about flips has assumed that a decoder exists, and constructing one is a real piece of work that this essay is not going to do. It is worth saying what shape it has, because otherwise the code looks easier than it is.
With erasures the positions are given and interpolation finishes the job. With flips the decoder must find the positions, and the obvious method — try every set of positions, assume those are wrong, interpolate from the rest, and see whether the result is consistent — costs interpolations, which at and is a number with thirty digits.
The practical algorithms do something cleverer. They compute a small number of syndromes — exactly the idea of the previous rung, generalised to this field — and then solve for an error-locator polynomial whose roots are the bad positions. Berlekamp and Massey found how to do that solve efficiently in the 1960s, and Sugiyama and others later showed it is Euclid’s algorithm on polynomials in disguise.
The relevant point for this page is that the syndrome trick survives the change of alphabet unchanged. A linear code’s check depends on the error and not on the message, whatever the field, so the decoder can work on the damage alone. What becomes harder is only the step of turning that damage into positions.
The same picture, used to keep a secret
The construction has a second life that is worth knowing, because it is the identical mathematics read with the roles swapped.
Take a secret and make it the constant term of a random polynomial of degree over a large field. Hand out values of that polynomial to people. Then any of them can reconstruct the polynomial and read off ; and any of them learn nothing at all, because for every candidate secret there is exactly one polynomial through their points with that constant term — the same count of possibilities that appeared above as a failure of decoding.
That is Shamir’s secret sharing, published in 1979, and it is the same object as the code wearing a different hat — the kind of double life this collection collects. The fact that the failure mode of the code is the security property of the scheme is not a coincidence. Both are the statement that points determine nothing about a degree- polynomial’s remaining freedom.
What the picture cannot show
The figures here draw the polynomial’s values as dots on a grid, and the grid is a genuine picture of the field — but it is a picture of a set, not of a line.
Over the real numbers a polynomial is a curve and interpolation is visibly a matter of a curve passing through points. Over there is no curve. The points do not lie on anything, there is no notion of between, and the dots in the first figure form no pattern the eye can complete. Everything that makes interpolation feel inevitable in the real case — smoothness, continuity, a Taylor series’s promise that local information determines the whole — is absent.
What survives is the algebra, and only the algebra: a system of linear equations in unknowns whose matrix is invertible because the evaluation points are distinct. The figures therefore verify by computation rather than by appearance, interpolating all thirty-five subsets rather than showing a curve and inviting the reader to believe it.
That gap is worth naming because it is the general condition of this field. A finite structure can be drawn, and the drawing is honest about what is there; what it cannot do is make the argument feel forced, because the intuitions that would do the forcing come from a continuous world this one has left.
Why this construction and not a cleverer one
There is something worth pausing on in how little the code does.
The Hamming code of the previous rungs is a design: three parity checks arranged so that their columns are the seven non-zero patterns, chosen to make the syndrome name a position. Change the arrangement and the code gets worse. It is an optimisation of a specific size.
This one is not designed at all. It is one sentence of algebra — a polynomial of low degree is determined by enough of its values — and every property follows without any choices being made. The distance is optimal at every length. The erasure tolerance is optimal at every length. The evaluation points can be any distinct elements, in any order.
That is unusual and it is why Reed–Solomon codes are everywhere. A construction with no parameters to tune has no way to be tuned badly, and a construction whose correctness is one root-counting argument has very little that can be got wrong. The engineering effort in a real deployment goes into the decoder and into the choice of field, never into the code.
The contrast with the classical constructions of the first anchor of this field is instructive. There, an operation set was fixed and the question was what could be reached. Here the reachable object was specified first — a set of -tuples pairwise far apart — and the arithmetic was chosen to make it exist. Both are questions about what a fixed set of rules produces; the difference is which end was pinned down.
Where this ladder ends
Four rungs: distance as a geometry, a perfect packing, a decoder that ignores the message, and a construction that meets the best possible bound at every size.
What every one of them needed was an arithmetic that closes — addition, multiplication and division on a finite set, with no exceptions and no zero divisors. That object was used freely here and never examined. The next anchor examines it: which finite sets support such an arithmetic, why the answer is the prime powers and nothing else, and why the field with four elements is not the integers modulo four.
What links here
Computed from the collection, not written here: the essays that point at this one.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- Distance is a picture — both name error correcting code, minimum distance
Named objects
A dashed tag is an object no other essay names yet.
ErasureError correcting codeFinite fieldInterpolationMinimum distancePolynomialReed solomonSingleton bound