Code correcting single insertion, deletion, or asymmetric (0โ1) error. Rate-1 code with log(n+1) redundancy bits. Uses weighted checksum: sum of iยทx_i โก a (mod n+1). Critical for DNA storage and optical communications where synchronization errors occur. Remarkably efficient for indel correction.
| Property | Value |
|---|---|
| Category | Error Correction |
| Sub-category | Insertion/Deletion Code |
| Security status | ๐ Educational Only |
| Complexity | Advanced |
| Inventor | R. R. Varshamov, G. M. Tenengolts |
| Year | 1965 |
| Origin | ๐ท๐บ Russia |
| Source | algorithms/ecc/varshamov-tenengolts.js |
Status: ๐ Educational Only
| Issue | Description | Mitigation |
|---|---|---|
| Single Error Only | Can only correct single insertion OR deletion OR asymmetric error, not multiple. | โ |
| Modulo Constraint | Requires knowledge of original word length for proper decoding. | โ |
4 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 โ VT (7,0) all zeros
| Field | Value |
|---|---|
n |
7 |
a |
0 |
input |
00000000000000 |
expected |
00000000000000 |
Vector 2 โ VT (7,0) sum=8: positions 1,7
| Field | Value |
|---|---|
n |
7 |
a |
0 |
input |
01000000000001 |
expected |
01000000000001 |
Vector 3 โ VT (7,0) sum=8: positions 2,6
| Field | Value |
|---|---|
n |
7 |
a |
0 |
input |
00010000000100 |
expected |
00010000000100 |
Vector 4 โ VT (7,3) sum=3: position 3
| Field | Value |
|---|---|
n |
7 |
a |
3 |
input |
00000100000000 |
expected |
00000100000000 |