Abstract
Adding redundant parts to data lets it be restored even if part of it is damaged on the way (error-correcting codes). How many damaged symbols can be repaired is counted exhaustively, for damage whose position is known (erasures) and unknown (errors). No new theorem or law is claimed.
First, the Hamming code repairs $1$ error or $2$ erasures——trying every codeword and every kind of damage in the code of length $7$ with $16$ codewords and minimum distance $3$, $1$ error was corrected in all $112$ cases, and $2$ errors were corrected correctly in none of $336$. With erasures, even $2$ were fixed uniquely in all $336$ (Section 2).
Second, even with $3$ erasures, four in five are fixed——with $3$ erasures, $448$ of $560$ cases ($\mathbf{0.800000}$) were fixed uniquely; the only failures were the $7$ cases in which the three erased positions coincide exactly with the $1$s of a weight-$3$ codeword (Section 2).
Third, and this is the core. One error costs as much as two erasures——in a Reed--Solomon code built modulo $13$, of length $12$ with $6$ information symbols and minimum distance $7$, mixing errors and erasures in $30$ random trials each, every combination with twice the errors plus the erasures at most $6$ ($3$ errors; $2$ errors and $2$ erasures; $1$ error and $4$ erasures; $6$ erasures) was always repaired (Section 3).
Fourth, beyond $6$, repair fails——with $4$ errors (a sum of $8$) only $2$ of $30$ were repaired, and with $3$ errors and $2$ erasures (also $8$) none. With $7$ erasures, the remaining $5$ symbols cannot determine $6$ information symbols (Section 3).
Fifth, the separator is whether the position of the damage is known——if it is, one only has to determine the original from what remains. If not, redundancy is also needed to find where the damage is, and the number that can be repaired halves (Section 4).
Keywords: error-correcting code, erasure correction, Hamming code, Reed-Solomon code, minimum distance.
Scope (what is not claimed)
No new theorem or law is claimed——the Hamming code (Hamming, $1950$), Reed--Solomon codes (Reed and Solomon, $1960$), and the condition for repairing errors and erasures together (Forney, $1965$, and others; in the textbook by MacWilliams and Sloane) are all known. Fast decoding methods are not treated——the Hamming code is checked by trying every codeword and every kind of damage, and the Reed--Solomon code by exhaustively choosing as many points as there are information symbols and interpolating. Implementations are not discussed——how QR codes or optical discs actually use them is not entered. Relation to earlier papers: Paper 597 showed that the Hamming code of length $7$ fills its $128$ words exactly with spheres of radius $1$, and that the numerical condition alone does not decide whether a code exists——this paper looks, in the same Hamming code, at the side where knowing the position of the damage doubles what can be repaired. What is added is counting errors and erasures over every kind of damage in the Hamming code, confirming that the undetermined cases with $3$ erasures coincide with the weight-$3$ codewords, mixing errors and erasures in a Reed--Solomon code and showing the boundary of repair in numbers, and placing the separator on whether the position is known.
1. Notation and the Question
Setting: a set of codewords of length $n$ is a code, and the least number of positions in which two codewords differ is its minimum distance $d$. When part of a received word is damaged, damage at known positions is called an erasure, at unknown positions an error. With $e$ errors and $f$ erasures, if
$$2e+f\le d-1,$$the original codeword is always determined uniquely.
Question: how does this boundary appear when actually tried, and why does an error cost twice as much as an erasure?
2. The Hamming Code
Computation 2.1: in the Hamming code of length $7$ ($16$ codewords, minimum distance $3$), every codeword and every kind of damage was tried. An error was corrected to the nearest codeword, counted as “repaired” if unique and equal to the original. An erasure was counted as “fixed” if only one codeword agreed at the undamaged positions.
| damage | cases | repaired or fixed |
|---|---|---|
| $1$ error | $112$ | $112$ |
| $2$ errors | $336$ | $0$ |
| $1$ erasure | $112$ | $112$ |
| $2$ erasures | $336$ | $336$ |
| $3$ erasures | $560$ | $448$ ($\mathbf{0.800000}$) |
| $4$ erasures | $560$ | $0$ |
Observation 2.2 in the same code, $1$ error or $2$ erasures are always repaired. With minimum distance $3$, $2e+f\le2$, so $1$ error or $2$ erasures is the boundary——with $2$ errors the nearest codeword is a different one, and none was repaired correctly. Trying to correct, the decoder rewrites the word into another codeword.
Computation 2.3: the position triples for which $3$ erasures were not fixed uniquely numbered $7$ of $35$, coinciding exactly with the positions of the $1$s of the $7$ weight-$3$ codewords.
Observation 2.4 past the boundary, erasures do not all fail at once. Only when the three erased positions coincide with the $1$s of some codeword can the word not be told from the word with that codeword added——in the other $28$ triples the word was fixed uniquely even beyond the boundary. The boundary is where “always repaired” ends, not where “not repaired” begins.
3. The Reed--Solomon Code
Computation 3.1: a code was built from the values at $x=1,\dots,12$ of polynomials of degree at most $5$ with numbers modulo $13$ (length $12$, $6$ information symbols, minimum distance $7$). It was damaged with mixed errors and erasures in $30$ random trials each, and by exhaustively choosing $6$ undamaged points and interpolating, the polynomial agreeing with the most positions was sought. It counted as “repaired” if unique and equal to the original.
| errors | erasures | $2e+f$ | repaired (of $30$) |
|---|---|---|---|
| $3$ | $0$ | $6$ | $30$ |
| $2$ | $2$ | $6$ | $30$ |
| $1$ | $4$ | $6$ | $30$ |
| $0$ | $6$ | $6$ | $30$ |
| $4$ | $0$ | $8$ | $2$ |
| $3$ | $2$ | $8$ | $0$ |
| $0$ | $7$ | $7$ | $0$ |
Observation 3.2 this is the core: one error costs as much as two erasures. The four combinations with $2e+f\le6$, from $3$ errors to $6$ erasures, were all repaired in every one of $30$ trials. Replacing $1$ error by $2$ erasures does not change what can be repaired——beyond the boundary, $4$ errors were repaired only twice and $3$ errors with $2$ erasures never.
4. The Separator
Observation 4.1 the separator is whether the position of the damage is known. With erasures at known positions, the original only has to be determined from the remaining positions; in the Reed--Solomon code, exactly one polynomial passes through the $6$ remaining points——with errors at unknown positions, one must first find where the damage is. Redundancy is used for that finding too, so the number that can be repaired halves.
Observation 4.2 beside Paper 597. Paper 597 showed that the Hamming code of length $7$ fills its $128$ words exactly with spheres of radius $1$ around the codewords——that radius $1$ is the range within which errors of unknown position can be corrected. With positions known, the same code reaches twice as far, to $2$.
Observation 4.3 what is not said. Fast decoding is not treated; everything was checked exhaustively. How QR codes or optical discs use these codes is not entered——what is shown is that the boundary between errors and erasures appears in exhaustive results, and that one error counts as two erasures.
5. Roll Call and Closing
- $1$ error in the Hamming code: $112/112$ (Computation 2.1): always repaired.
- $2$ errors: $0/336$ (Computation 2.1): rewritten into another codeword.
- $2$ erasures: $336/336$ (Computation 2.1): repaired up to twice as many.
- $3$ erasures still fix $\mathbf{0.800000}$ (Computation 2.1): the boundary is that of “always”.
- the $7$ undetermined triples are the weight-$3$ codewords (Computation 2.3): an exact match.
- Reed--Solomon: $2e+f\le6$ always repaired (Computation 3.1): $30/30$ for four combinations.
- $4$ errors: $2/30$ (Computation 3.1): past the boundary.
- one error costs two erasures (Observation 3.2): the core.
- the separator is whether the position is known (Observation 4.1): redundancy spent on finding.
- the radius-$1$ spheres are the range for errors (Observation 4.2): Paper 597.
Closing: Error-correcting codes use redundant parts to repair damaged ones. If the positions of the damage are known, twice as much can be repaired as when they are not——the Hamming code of length $7$ corrects only $1$ error of unknown position and repairs none of $2$ correctly, but always fixes $2$ erasures of known position, and even with $3$ fixed $0.800000$ of cases. One error costs as much as two erasures——in a Reed--Solomon code of length $12$, whenever twice the errors plus the erasures was at most $6$, repair always succeeded, and beyond that it failed. The separator is whether the position of the damage is known——if not, redundancy is spent on finding it as well. Placed among the earlier papers——the radius-$1$ spheres of Paper 597 are the range for correcting errors, and with positions known the same code reaches twice as far. To be honest——neither fast decoding nor implementations are treated; everything was only counted exhaustively.
References
- Forney, G. D. (1965). On decoding BCH codes. IEEE Transactions on Information Theory.
- Hamming, R. W. (1950). Error detecting and error correcting codes. The Bell System Technical Journal.
- MacWilliams, F. J., & Sloane, N. J. A. (1977). The Theory of Error-Correcting Codes. North-Holland.
- Reed, I. S., & Solomon, G. (1960). Polynomial codes over certain finite fields. Journal of the Society for Industrial and Applied Mathematics.
- Yamagishi, Y. (2026). Meeting the Condition That the Spheres Fill Space Exactly Does Not Mean the Code Exists [Paper 597]. Zenodo. 10.5281/zenodo.23014414
Reference
Yamagishi, Y. (2026). Knowing Where the Damage Is Lets a Code Repair Twice as Much [Paper 619]. YOI: https://www.yamagishiyuuki.com/yoi/619
DOI: 10.5281/zenodo.23014510
ORCID: 0009-0006-8587-3450
PDF (English) · PDF (Japanese) · Date proof of the English PDF (OpenTimestamps .ots) · SHA256SUMS
The record page for this paper (in Japanese, with the PDFs in each language and the date proof): YOI 619. This paper is a preprint and has not been peer reviewed.