HOME

TheInfoList



OR:

In
coding theory Coding theory is the study of the properties of codes and their respective fitness for specific applications. Codes are used for data compression, cryptography, error detection and correction, data transmission and computer data storage, data sto ...
, a linear code is an
error-correcting code In computing, telecommunication, information theory, and coding theory, forward error correction (FEC) or channel coding is a technique used for controlling errors in data transmission over unreliable or noisy communication channels. The centra ...
for which any
linear combination In mathematics, a linear combination or superposition is an Expression (mathematics), expression constructed from a Set (mathematics), set of terms by multiplying each term by a constant and adding the results (e.g. a linear combination of ''x'' a ...
of codewords is also a codeword. Linear codes are traditionally partitioned into
block code In coding theory, block codes are a large and important family of Channel coding, error-correcting codes that encode data in blocks. There is a vast number of examples for block codes, many of which have a wide range of practical applications. Th ...
s and
convolutional code In telecommunication, a convolutional code is a type of error-correcting code that generates parity symbols via the sliding application of a boolean polynomial function to a data stream. The sliding application represents the 'convolution' of th ...
s, although turbo codes can be seen as a hybrid of these two types. Linear codes allow for more efficient encoding and decoding algorithms than other codes (cf.
syndrome decoding In coding theory, decoding is the process of translating received messages into codewords of a given code. There have been many common methods of mapping messages to codewords. These are often used to recover messages sent over a noisy channel, ...
). Linear codes are used in
forward error correction In computing, telecommunication, information theory, and coding theory, forward error correction (FEC) or channel coding is a technique used for controlling errors in data transmission over unreliable or noisy communication channels. The centra ...
and are applied in methods for transmitting symbols (e.g.,
bit The bit is the most basic unit of information in computing and digital communication. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented as ...
s) on a
communications channel A communication channel refers either to a physical transmission medium such as a wire, or to a logical connection over a multiplexed medium such as a radio channel in telecommunications and computer networking. A channel is used for inform ...
so that, if errors occur in the communication, some errors can be corrected or detected by the recipient of a message block. The codewords in a linear block code are blocks of symbols that are encoded using more symbols than the original value to be sent. A linear code of length ''n'' transmits blocks containing ''n'' symbols. For example, the ,4,3
Hamming code In computer science and telecommunications, Hamming codes are a family of linear error-correcting codes. Hamming codes can detect one-bit and two-bit errors, or correct one-bit errors without detection of uncorrected errors. By contrast, the ...
is a linear
binary code A binary code represents plain text, text, instruction set, computer processor instructions, or any other data using a two-symbol system. The two-symbol system used is often "0" and "1" from the binary number, binary number system. The binary cod ...
which represents 4-bit messages using 7-bit codewords. Two distinct codewords differ in at least three bits. As a consequence, up to two errors per codeword can be detected while a single error can be corrected. This code contains 24 = 16 codewords.


Definition and parameters

A linear code of length ''n'' and dimension ''k'' is a
linear subspace In mathematics, the term ''linear'' is used in two distinct senses for two different properties: * linearity of a ''function (mathematics), function'' (or ''mapping (mathematics), mapping''); * linearity of a ''polynomial''. An example of a li ...
''C'' with
dimension In physics and mathematics, the dimension of a mathematical space (or object) is informally defined as the minimum number of coordinates needed to specify any point within it. Thus, a line has a dimension of one (1D) because only one coo ...
''k'' of the
vector space In mathematics and physics, a vector space (also called a linear space) is a set (mathematics), set whose elements, often called vector (mathematics and physics), ''vectors'', can be added together and multiplied ("scaled") by numbers called sc ...
\mathbb_q^n where \mathbb_q is the
finite field In mathematics, a finite field or Galois field (so-named in honor of Évariste Galois) is a field (mathematics), field that contains a finite number of Element (mathematics), elements. As with any field, a finite field is a Set (mathematics), s ...
with ''q'' elements. Such a code is called a ''q''-ary code. If ''q'' = 2 or ''q'' = 3, the code is described as a binary code, or a ternary code respectively. The vectors in ''C'' are called ''codewords''. The size of a code is the number of codewords and equals ''q''''k''. The weight of a codeword is the number of its elements that are nonzero and the distance between two codewords is the
Hamming distance In information theory, the Hamming distance between two String (computer science), strings or vectors of equal length is the number of positions at which the corresponding symbols are different. In other words, it measures the minimum number ...
between them, that is, the number of elements in which they differ. The distance ''d'' of the linear code is the minimum weight of its nonzero codewords, or equivalently, the minimum distance between distinct codewords. A linear code of length ''n'', dimension ''k'', and distance ''d'' is called an 'n'',''k'',''d''code (or, more precisely, ,k,dq code). We want to give \mathbb_q^n the standard basis because each coordinate represents a "bit" that is transmitted across a "noisy channel" with some small probability of transmission error (a
binary symmetric channel A binary symmetric channel (or BSCp) is a common communications channel model used in coding theory and information theory. In this model, a transmitter wishes to send a bit (a zero or a one), and the receiver will receive a bit. The bit will be ...
). If some other basis is used then this model cannot be used and the Hamming metric does not measure the number of errors in transmission, as we want it to.


Generator and check matrices

As a
linear subspace In mathematics, the term ''linear'' is used in two distinct senses for two different properties: * linearity of a ''function (mathematics), function'' (or ''mapping (mathematics), mapping''); * linearity of a ''polynomial''. An example of a li ...
of \mathbb_q^n, the entire code ''C'' (which may be very large) may be represented as the span of a set of k codewords (known as a basis in
linear algebra Linear algebra is the branch of mathematics concerning linear equations such as :a_1x_1+\cdots +a_nx_n=b, linear maps such as :(x_1, \ldots, x_n) \mapsto a_1x_1+\cdots +a_nx_n, and their representations in vector spaces and through matrix (mathemat ...
). These basis codewords are often collated in the rows of a matrix G known as a generating matrix for the code ''C''. When G has the block matrix form \boldsymbol = _k \mid P/math>, where I_k denotes the k \times k identity matrix and P is some k \times (n-k) matrix, then we say G is in standard form. A matrix ''H'' representing a linear function \phi : \mathbb_q^n\to \mathbb_q^ whose kernel is ''C'' is called a
check matrix Check or cheque, may refer to: Places * Check, Virginia Arts, entertainment, and media * ''Check'' (film), a 2021 Indian Telugu-language film * "The Check" (''The Amazing World of Gumball''), a 2015 episode of ''The Amazing World of Gumball'' ...
of ''C'' (or sometimes a parity check matrix). Equivalently, ''H'' is a matrix whose
null space In mathematics, the kernel of a linear map, also known as the null space or nullspace, is the part of the domain which is mapped to the zero vector of the co-domain; the kernel is always a linear subspace of the domain. That is, given a linear ...
is ''C''. If ''C'' is a code with a generating matrix ''G'' in standard form, \boldsymbol = _k \mid P/math>, then \boldsymbol = P^T \mid I_ /math> is a check matrix for C. The code generated by ''H'' is called the dual code of C. It can be verified that G is a k \times n matrix, while H is a (n-k) \times n matrix. Linearity guarantees that the minimum
Hamming distance In information theory, the Hamming distance between two String (computer science), strings or vectors of equal length is the number of positions at which the corresponding symbols are different. In other words, it measures the minimum number ...
''d'' between a codeword ''c''0 and any of the other codewords ''c'' ≠ ''c''0 is independent of ''c''0. This follows from the property that the difference ''c'' − ''c''0 of two codewords in ''C'' is also a codeword (i.e., an element of the subspace ''C''), and the property that ''d''(''c'', c0) = ''d''(''c'' − ''c''0, 0). These properties imply that :\min_d(c,c_0)=\min_d(c-c_0, 0)=\min_d(c, 0)=d. In other words, in order to find out the minimum distance between the codewords of a linear code, one would only need to look at the non-zero codewords. The non-zero codeword with the smallest weight has then the minimum distance to the zero codeword, and hence determines the minimum distance of the code. The distance ''d'' of a linear code ''C'' also equals the minimum number of linearly dependent columns of the check matrix ''H''. ''Proof:'' Because \boldsymbol \cdot \boldsymbol^T = \boldsymbol, which is equivalent to \sum_^n (c_i \cdot \boldsymbol) = \boldsymbol, where \boldsymbol is the i^ column of \boldsymbol. Remove those items with c_i=0, those \boldsymbol with c_i \neq 0 are linearly dependent. Therefore, d is at least the minimum number of linearly dependent columns. On another hand, consider the minimum set of linearly dependent columns \ where S is the column index set. \sum_^n (c_i \cdot \boldsymbol) = \sum_ (c_j \cdot \boldsymbol) + \sum_ (c_j \cdot \boldsymbol) = \boldsymbol. Now consider the vector \boldsymbol such that c_j'=0 if j \notin S. Note \boldsymbol \in C because \boldsymbol \cdot \boldsymbol^T = \boldsymbol . Therefore, we have d \le wt(\boldsymbol) , which is the minimum number of linearly dependent columns in \boldsymbol. The claimed property is therefore proven.


Example: Hamming codes

As the first class of linear codes developed for error correction purpose, ''Hamming codes'' have been widely used in digital communication systems. For any positive integer r \ge 2 , there exists a ^r-1, 2^r-r-1,32 Hamming code. Since d=3, this Hamming code can correct a 1-bit error. Example : The linear block code with the following generator matrix and parity check matrix is a ,4,32 Hamming code. : \boldsymbol=\begin 1& 0& 0& 0& 1& 1& 0 \\ 0& 1& 0& 0& 0& 1& 1 \\ 0& 0& 1& 0& 1& 1& 1 \\ 0& 0& 0& 1& 1& 0& 1 \end , \boldsymbol=\begin 1& 0& 1& 1& 1& 0& 0 \\ 1& 1&\ 1& 0& 0& 1& 0 \\ 0& 1& 1& 1& 0& 0& 1 \end


Example: Hadamard codes

Hadamard code The Hadamard code is an error-correcting code named after the French mathematician Jacques Hadamard that is used for error detection and correction when transmitting messages over very noisy or unreliable channels. In 1971, the code was used ...
is a ^r, r, 2^2 linear code and is capable of correcting many errors. Hadamard code could be constructed column by column : the i^ column is the bits of the binary representation of integer i, as shown in the following example. Hadamard code has minimum distance 2^ and therefore can correct 2^-1 errors. Example: The linear block code with the following generator matrix is a ,3,42 Hadamard code: \boldsymbol_\mathrm=\begin 0& 0& 0& 0& 1&\ 1&1& 1\\ 0& 0& 1& 1& 0& 0& 1& 1\\ 0& 1& 0& 1& 0& 1& 0& 1\end.
Hadamard code The Hadamard code is an error-correcting code named after the French mathematician Jacques Hadamard that is used for error detection and correction when transmitting messages over very noisy or unreliable channels. In 1971, the code was used ...
is a special case of
Reed–Muller code Reed–Muller codes are error-correcting codes that are used in wireless communications applications, particularly in deep-space communication. Moreover, the proposed 5G standard relies on the closely related polar codes for error correction i ...
. If we take the first column (the all-zero column) out from \boldsymbol_\mathrm, we get ,3,42 ''simplex code'', which is the ''dual code '' of Hamming code.


Nearest neighbor algorithm

The parameter d is closely related to the error correcting ability of the code. The following construction/algorithm illustrates this (called the nearest neighbor decoding algorithm): Input: A ''received vector'' v in \mathbb_q^n. Output: A codeword w in C closest to v, if any. *Starting with t=0, repeat the following two steps. *Enumerate the elements of the ball of (Hamming) radius t around the received word v, denoted B_t(v). **For each w in B_t(v), check if w in C. If so, return w as the solution. *Increment t. Fail only when t > (d - 1)/2 so enumeration is complete and no solution has been found. We say that a linear C is t-error correcting if there is at most one codeword in B_t(v), for each v in \mathbb_q^n.


Popular notation

Code In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communicati ...
s in general are often denoted by the letter ''C'', and a code of length ''n'' and of
rank A rank is a position in a hierarchy. It can be formally recognized—for example, cardinal, chief executive officer, general, professor—or unofficial. People Formal ranks * Academic rank * Corporate title * Diplomatic rank * Hierarchy ...
''k'' (i.e., having ''n'' code words in its basis and ''k'' rows in its ''generating matrix'') is generally referred to as an (''n'', ''k'') code. Linear block codes are frequently denoted as 'n'', ''k'', ''d''codes, where ''d'' refers to the code's minimum Hamming distance between any two code words. (The 'n'', ''k'', ''d''notation should not be confused with the (''n'', ''M'', ''d'') notation used to denote a ''non-linear'' code of length ''n'', size ''M'' (i.e., having ''M'' code words), and minimum Hamming distance ''d''.)


Singleton bound

''Lemma'' (
Singleton bound In coding theory, the Singleton bound, named after the American mathematician Richard Collom Singleton (1928–2007), is a relatively crude upper bound on the size of an arbitrary block code C with block length n, size M and minimum distance d. It ...
): Every linear 'n'',''k'',''d''code C satisfies k+d \leq n+1. A code ''C'' whose parameters satisfy ''k'' +''d'' = ''n'' + 1 is called maximum distance separable or MDS. Such codes, when they exist, are in some sense best possible. If ''C''1 and ''C''2 are two codes of length ''n'' and if there is a permutation ''p'' in the
symmetric group In abstract algebra, the symmetric group defined over any set is the group whose elements are all the bijections from the set to itself, and whose group operation is the composition of functions. In particular, the finite symmetric grou ...
''S''''n'' for which (''c''1,...,''c''''n'') in ''C''1 if and only if (''c''''p''(1),...,''c''''p''(''n'')) in ''C''2, then we say ''C''1 and ''C''2 are permutation equivalent. In more generality, if there is an n\times n monomial matrix M\colon \mathbb_q^n \to \mathbb_q^n which sends ''C''1 isomorphically to ''C''2 then we say ''C''1 and ''C''2 are equivalent. ''Lemma'': Any linear code is permutation equivalent to a code which is in standard form.


Bonisoli's theorem

A code is defined to be equidistant if and only if there exists some constant ''d'' such that the distance between any two of the code's distinct codewords is equal to ''d''. In 1984 Arrigo Bonisoli determined the structure of linear one-weight codes over finite fields and proved that every equidistant linear code is a sequence of dual
Hamming code In computer science and telecommunications, Hamming codes are a family of linear error-correcting codes. Hamming codes can detect one-bit and two-bit errors, or correct one-bit errors without detection of uncorrected errors. By contrast, the ...
s.


Examples

Some examples of linear codes include: *
Repetition code In coding theory, the repetition code is one of the most basic linear error-correcting codes. In order to transmit a message over a noisy channel that may corrupt the transmission in a few places, the idea of the repetition code is to just repeat ...
*
Parity code A parity bit, or check bit, is a bit added to a string of binary code. Parity bits are a simple form of Error detection and correction, error detecting code. Parity bits are generally applied to the smallest units of a communication protocol, ...
*
Cyclic code In coding theory, a cyclic code is a block code, where the circular shifts of each codeword gives another word that belongs to the code. They are error-correcting codes that have algebraic properties that are convenient for efficient error detecti ...
*
Hamming code In computer science and telecommunications, Hamming codes are a family of linear error-correcting codes. Hamming codes can detect one-bit and two-bit errors, or correct one-bit errors without detection of uncorrected errors. By contrast, the ...
* Golay code, both the binary and ternary versions *
Polynomial code In coding theory, a polynomial code is a type of linear code whose set of valid code words consists of those polynomials (usually of some fixed length) that are divisible by a given fixed polynomial (of shorter length, called the ''generator polyno ...
s, of which
BCH code In coding theory, the Bose–Chaudhuri–Hocquenghem codes (BCH codes) form a class of cyclic error-correcting codes that are constructed using polynomials over a finite field (also called a '' Galois field''). BCH codes were invented in ...
s are an example * Reed–Solomon codes *
Reed–Muller code Reed–Muller codes are error-correcting codes that are used in wireless communications applications, particularly in deep-space communication. Moreover, the proposed 5G standard relies on the closely related polar codes for error correction i ...
* Algebraic geometry code * Binary Goppa code * Low-density parity-check codes * Expander code * Multidimensional parity-check code *
Toric code The toric code is a topological quantum error correcting code, and an example of a stabilizer code, defined on a two-dimensional spin lattice. It is the simplest and most well studied of the quantum double models. It is also the simplest example ...
* Turbo code * Locally recoverable code


Generalization

Hamming spaces over non-field alphabets have also been considered, especially over finite rings, most notably Galois rings over Z4. This gives rise to modules instead of vector spaces and ring-linear codes (identified with
submodule In mathematics, a module is a generalization of the notion of vector space in which the field of scalars is replaced by a (not necessarily commutative) ring. The concept of a ''module'' also generalizes the notion of an abelian group, since t ...
s) instead of linear codes. The typical metric used in this case the Lee distance. There exist a Gray isometry between \mathbb_2^ (i.e. GF(22''m'')) with the Hamming distance and \mathbb_4^m (also denoted as GR(4,m)) with the Lee distance; its main attraction is that it establishes a correspondence between some "good" codes that are not linear over \mathbb_2^ as images of ring-linear codes from \mathbb_4^m. Some authors have referred to such codes over rings simply as linear codes as well.


See also

*
Decoding methods In coding theory, decoding is the process of translating received messages into Code word (communication), codewords of a given code. There have been many common methods of mapping messages to codewords. These are often used to recover messages se ...


References


Bibliography

* Chapter 5 contains a more gentle introduction (than this article) to the subject of linear codes.


External links


''q''-ary code generator program

Code Tables: Bounds on the parameters of various types of codes
''IAKS, Fakultät für Informatik, Universität Karlsruhe (TH)]''. Online, up to date table of the optimal binary codes, includes non-binary codes.
The database of Z4 codes
Online, up to date database of optimal Z4 codes. {{DEFAULTSORT:Linear Code Coding theory Finite fields