CS Wiki | Cedric Schwyter

Error-Correcting Codes

Error-Correcting Codes

(Copied/paraphrased/annotated from the script on Discrete Mathematics HS21 by Prof. Ueli Maurer)

Motivation and Introduction

Error-correcting codes are used in many communication protocols and other applications. For example, the digital information on a CD is stored in such a manner that even if some of the information is lost (e.g. because of a scratch or dirt on the disc), the entire information can still be reconstructed without quality degradation, as long as sufficiently much of the data is still available.

There are two types of problems that can occur in data transmission or when reading data from a storage medium. First, data can be erased, meaning that when reading (or receiving) it one realizes that it is missing. Second, data can contain errors, The second type of problem is more severe because it is not even known where in a data stream the errors occurred. A good error-correcting scheme can handle both problems.

Encoding

💡 A -encoding function for some alphabet is an injective function that maps a list of (information) symbols to a list of (encoded) symbols in , called codeword:

For an encoding function one often consider the set

of codewords, which is called an error-correcting code.

💡 An -error-correcting code over the alphabet with is a subset of of cardinality .

It is natural to use as the alphabet , i.e., to take bits as the basic unit of information. However, for several reasons (one being the efficiency of encoding and in particular decoding), one often considers larger units of information, for example bytes (i.e., ).

💡 The Hamming distance between two strings of equal length over a finite alphabet is the number of positions at which the two strings differ.

💡 The minimum distance of an error-correcting code , denoted , is the minimum of the Hamming distance between two codewords.

Example

The following code is a -code over the alphabet :

The minimum distance is 3.

Decoding

💡 A decoding function for an -encoding function is a function .

The idea is that a good decoding function takes an arbitrary list of symbols and decodes it to the most plausible (in some sense) information vector . Moreover, a good decoding function should be efficiently computable.

The error-correcting capability of a code can be characterized in terms of the number of errors that can be corrected. More precisely:

💡 A decoding function is -error correcting for encoding function if for any

for any with Hamming distance at most from .

A code is -error correcting if there exists and with where is -error correcting.

📖 A code with minimum distance is -error correcting if and only if .

Proof: () If any two codewords have Hamming distance at least (i.e., differ in at least positions), then it is impossible that a word could result from two different codewords by changing positions. Thus if has a distance at most from a codeword , then this codeword is uniquely determined. The decoding function can be defined to decode to (one of) the nearest codeword(s) (more precisely, to the information resulting (by ) in that codeword).

() If there are two codewords that differ in at most positions, then there exists a word which differs from both codewords in at most positions; hence it is possible that errors can not be corrected. This proves the theorem.

Example

A code with minimum distance can correct errors. The code in the other example above can correct a single error ().

Codes based on Polynomial Evaluation

A very powerful class of codes is obtained by polynomial interpolation if has a field structure, i.e., for some :

📖 Let and let be arbitrary distinct elements of . Consider the encoding function

where is the polynomial

This code has minimum distance .

Proof: The polynomial of degree can be interpolated from any values, i.e., from any codeword symbols. If two polynomials agree for arguments (or, equivalently, if two codewords agree at positions), then they are equal. This means that two different codewords cannot agree at positions. Hence any two codewords disagree in at least positions. This proves the theorem.

An ()-code over the field can be interpreted as a binary ()-code (over ). The minimum distance of this binary code is at least that of the original code because two different -symbols must differ in at least one bit (but can of course differ in more than one bit).

Example

Polynomial codes as described are used for storing information on Compact Discs. In fact, the coding scheme of CD’s makes use of two different such codes. The field is defined by an irreducible polynomial of degree 8 over and the two codes are a (32, 28)-code over and a (28, 24)-code over , both with minimum distance 5.

This project is maintained by D3PSI