<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Linear_code</id>
	<title>Linear code - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Linear_code"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Linear_code&amp;action=history"/>
	<updated>2026-05-03T08:04:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Linear_code&amp;diff=1365062&amp;oldid=prev</id>
		<title>imported&gt;Michael Hardy at 03:34, 28 November 2024</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Linear_code&amp;diff=1365062&amp;oldid=prev"/>
		<updated>2024-11-28T03:34:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Class of error-correcting code}}&lt;br /&gt;
In [[coding theory]], a &amp;#039;&amp;#039;&amp;#039;linear code&amp;#039;&amp;#039;&amp;#039; is an [[error-correcting code]] for which any [[linear combination]] of [[Code word (communication)|codewords]] is also a codeword. Linear codes are traditionally partitioned into [[block code]]s and [[convolutional code]]s, although [[turbo code]]s can be seen as a hybrid of these two types.&amp;lt;ref&amp;gt;{{cite book|title=Channel Codes: Classical and Modern|url=https://archive.org/details/channelcodesclas00ryan|url-access=limited|author=William E. Ryan and Shu Lin|page=[https://archive.org/details/channelcodesclas00ryan/page/n21 4]|year=2009|publisher=Cambridge University Press|isbn=978-0-521-84868-8}}&amp;lt;/ref&amp;gt; Linear codes allow for more efficient encoding and decoding algorithms than other codes (cf. [[syndrome decoding]]).{{citation needed|date=April 2018}}&lt;br /&gt;
&lt;br /&gt;
Linear codes are used in [[forward error correction]] and are applied in methods for transmitting symbols (e.g., [[bit]]s) on a [[communications channel]] 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.&amp;lt;ref name=&amp;quot;DrMacKayECC&amp;quot;&amp;gt;{{cite book| last=MacKay | first=David, J.C.| authorlink=David J.C. MacKay| title=Information Theory, Inference, and Learning Algorithms |year=2003 | pages=9|publisher=[[Cambridge University Press]]| isbn=9780521642989|url=http://www.inference.phy.cam.ac.uk/itprnn/book.pdf | quote=&amp;quot;In a &amp;#039;&amp;#039;linear&amp;#039;&amp;#039; block code, the extra &amp;lt;math&amp;gt;N - K&amp;lt;/math&amp;gt; bits are linear functions of the original &amp;lt;math&amp;gt;K&amp;lt;/math&amp;gt; bits; these extra bits are called &amp;#039;&amp;#039;parity-check bits&amp;#039;&amp;#039;&amp;quot;| bibcode=2003itil.book.....M}}&amp;lt;/ref&amp;gt;  A linear code of length &amp;#039;&amp;#039;n&amp;#039;&amp;#039; transmits blocks containing &amp;#039;&amp;#039;n&amp;#039;&amp;#039; symbols.  For example, the [7,4,3] [[Hamming code]] is a linear [[binary code]] 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.&amp;lt;ref name=&amp;quot;Cover_and_Thomas&amp;quot;&amp;gt;{{cite book|title=Elements of Information Theory|author=Thomas M. Cover and Joy A. Thomas|pages=[https://archive.org/details/elementsofinform0000cove/page/210 210–211]|year=1991|publisher=John Wiley &amp;amp; Sons, Inc|isbn=978-0-471-06259-2|url=https://archive.org/details/elementsofinform0000cove/page/210}}&amp;lt;/ref&amp;gt;  This code contains 2&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;&amp;amp;nbsp;=&amp;amp;nbsp;16 codewords.&lt;br /&gt;
&lt;br /&gt;
==Definition and parameters==&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;linear code&amp;#039;&amp;#039;&amp;#039; of length &amp;#039;&amp;#039;n&amp;#039;&amp;#039; and dimension &amp;#039;&amp;#039;k&amp;#039;&amp;#039; is a [[linear subspace]] &amp;#039;&amp;#039;C&amp;#039;&amp;#039; with [[dimension (linear algebra)|dimension]] &amp;#039;&amp;#039;k&amp;#039;&amp;#039; of the [[vector space]] &amp;lt;math&amp;gt;\mathbb{F}_q^n&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\mathbb{F}_q&amp;lt;/math&amp;gt; is the [[finite field]] with &amp;#039;&amp;#039;q&amp;#039;&amp;#039; elements.  Such a code is called a &amp;#039;&amp;#039;q&amp;#039;&amp;#039;-ary code.  If &amp;#039;&amp;#039;q&amp;#039;&amp;#039;&amp;amp;nbsp;=&amp;amp;nbsp;2 or &amp;#039;&amp;#039;q&amp;#039;&amp;#039;&amp;amp;nbsp;=&amp;amp;nbsp;3, the code is described as a &amp;#039;&amp;#039;&amp;#039;binary code&amp;#039;&amp;#039;&amp;#039;, or a &amp;#039;&amp;#039;&amp;#039;ternary code&amp;#039;&amp;#039;&amp;#039; respectively.  The vectors in &amp;#039;&amp;#039;C&amp;#039;&amp;#039; are called &amp;#039;&amp;#039;codewords&amp;#039;&amp;#039;.  The &amp;#039;&amp;#039;&amp;#039;size&amp;#039;&amp;#039;&amp;#039; of a code is the number of codewords and equals &amp;#039;&amp;#039;q&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;&amp;#039;&amp;#039;k&amp;#039;&amp;#039;&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;weight&amp;#039;&amp;#039;&amp;#039; of a codeword is the number of its elements that are nonzero and the &amp;#039;&amp;#039;&amp;#039;distance&amp;#039;&amp;#039;&amp;#039; between two codewords is the [[Hamming distance]] between them, that is, the number of elements in which they differ.  The distance &amp;#039;&amp;#039;d&amp;#039;&amp;#039; 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 &amp;#039;&amp;#039;n&amp;#039;&amp;#039;, dimension &amp;#039;&amp;#039;k&amp;#039;&amp;#039;, and distance &amp;#039;&amp;#039;d&amp;#039;&amp;#039; is called an [&amp;#039;&amp;#039;n&amp;#039;&amp;#039;,&amp;#039;&amp;#039;k&amp;#039;&amp;#039;,&amp;#039;&amp;#039;d&amp;#039;&amp;#039;] code (or, more precisely, &amp;lt;math&amp;gt;[n,k,d]_q&amp;lt;/math&amp;gt; code).&lt;br /&gt;
&lt;br /&gt;
We want to give &amp;lt;math&amp;gt;\mathbb{F}_q^n&amp;lt;/math&amp;gt; the standard basis because each coordinate represents a &amp;quot;bit&amp;quot; that is transmitted across a &amp;quot;noisy channel&amp;quot; with some small probability of transmission error (a [[binary symmetric channel]]). 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.&lt;br /&gt;
&lt;br /&gt;
== Generator and check matrices ==&lt;br /&gt;
As a [[linear subspace]] of &amp;lt;math&amp;gt;\mathbb{F}_q^n&amp;lt;/math&amp;gt;, the entire code &amp;#039;&amp;#039;C&amp;#039;&amp;#039; (which may be very large) may be represented as the [[span (linear algebra)|span]] of a set of &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; codewords (known as a [[basis (linear algebra)|basis]] in [[linear algebra]]). These basis codewords are often collated in the rows of a matrix G known as a &amp;#039;&amp;#039;&amp;#039;[[Generator matrix|generating matrix]]&amp;#039;&amp;#039;&amp;#039; for the code &amp;#039;&amp;#039;C&amp;#039;&amp;#039;. When G has the block matrix form &amp;lt;math&amp;gt;\boldsymbol{G} = [I_k \mid P]&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;I_k&amp;lt;/math&amp;gt; denotes the &amp;lt;math&amp;gt;k \times k&amp;lt;/math&amp;gt; identity matrix and P is some &amp;lt;math&amp;gt;k \times (n-k)&amp;lt;/math&amp;gt; matrix, then we say G is in &amp;#039;&amp;#039;&amp;#039;standard form&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A matrix &amp;#039;&amp;#039;H&amp;#039;&amp;#039; representing a linear function &amp;lt;math&amp;gt;\phi : \mathbb{F}_q^n\to \mathbb{F}_q^{n-k}&amp;lt;/math&amp;gt; whose [[Kernel (matrix)|kernel]] is &amp;#039;&amp;#039;C&amp;#039;&amp;#039; is called a &amp;#039;&amp;#039;&amp;#039;[[check matrix]]&amp;#039;&amp;#039;&amp;#039; of &amp;#039;&amp;#039;C&amp;#039;&amp;#039; (or sometimes a parity check matrix).  Equivalently, &amp;#039;&amp;#039;H&amp;#039;&amp;#039; is a matrix whose [[null space]] is &amp;#039;&amp;#039;C&amp;#039;&amp;#039;.  If &amp;#039;&amp;#039;C&amp;#039;&amp;#039; is a code with a generating matrix &amp;#039;&amp;#039;G&amp;#039;&amp;#039; in standard form, &amp;lt;math&amp;gt;\boldsymbol{G} = [I_k \mid P]&amp;lt;/math&amp;gt;, then &amp;lt;math&amp;gt;\boldsymbol{H} = [-P^T \mid I_{n-k} ]&amp;lt;/math&amp;gt; is a check matrix for C.  The code generated by &amp;#039;&amp;#039;H&amp;#039;&amp;#039; is called the &amp;#039;&amp;#039;&amp;#039;dual code&amp;#039;&amp;#039;&amp;#039; of C. It can be verified that G is a &amp;lt;math&amp;gt;k \times n&amp;lt;/math&amp;gt; matrix, while H is a &amp;lt;math&amp;gt;(n-k) \times n&amp;lt;/math&amp;gt; matrix.&lt;br /&gt;
&lt;br /&gt;
Linearity guarantees that the minimum [[Hamming distance]] &amp;#039;&amp;#039;d&amp;#039;&amp;#039; between a codeword &amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; and any of the other codewords &amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;amp;nbsp;≠&amp;amp;nbsp;&amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; is independent of &amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;.  This follows from the property that the difference &amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;amp;nbsp;&amp;amp;minus;&amp;amp;nbsp;&amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; of two codewords in &amp;#039;&amp;#039;C&amp;#039;&amp;#039; is also a codeword (i.e., an [[element (mathematics)|element]] of the subspace &amp;#039;&amp;#039;C&amp;#039;&amp;#039;), and the property that &amp;#039;&amp;#039;d&amp;#039;&amp;#039;(&amp;#039;&amp;#039;c&amp;#039;&amp;#039;,&amp;amp;nbsp;c&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;)&amp;amp;nbsp;=&amp;amp;nbsp;&amp;#039;&amp;#039;d&amp;#039;&amp;#039;(&amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;amp;nbsp;&amp;amp;minus;&amp;amp;nbsp;&amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;,&amp;amp;nbsp;0).  These properties imply that&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\min_{c \in C,\ c \neq c_0}d(c,c_0)=\min_{c \in C,\ c \neq c_0}d(c-c_0, 0)=\min_{c \in C,\ c \neq 0}d(c, 0)=d.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The distance &amp;#039;&amp;#039;d&amp;#039;&amp;#039; of a linear code &amp;#039;&amp;#039;C&amp;#039;&amp;#039; also equals the minimum number of linearly dependent columns of the check matrix &amp;#039;&amp;#039;H&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Proof:&amp;#039;&amp;#039; Because  &amp;lt;math&amp;gt;\boldsymbol{H} \cdot \boldsymbol{c}^T = \boldsymbol{0}&amp;lt;/math&amp;gt;, which is equivalent to &amp;lt;math&amp;gt;\sum_{i=1}^n (c_i \cdot \boldsymbol{H_i}) = \boldsymbol{0}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;\boldsymbol{H_i}&amp;lt;/math&amp;gt; is the &amp;lt;math&amp;gt;i^{th}&amp;lt;/math&amp;gt; column of &amp;lt;math&amp;gt;\boldsymbol{H}&amp;lt;/math&amp;gt;. Remove those items with &amp;lt;math&amp;gt;c_i=0&amp;lt;/math&amp;gt;, those &amp;lt;math&amp;gt;\boldsymbol{H_i}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;c_i \neq 0&amp;lt;/math&amp;gt; are linearly dependent. Therefore, &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; is at least the minimum number of linearly dependent columns. On another hand, consider the minimum set of linearly dependent columns &amp;lt;math&amp;gt;\{ \boldsymbol{H_j} \mid j \in S \}&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is the column index set.  &amp;lt;math&amp;gt;\sum_{i=1}^n (c_i \cdot \boldsymbol{H_i}) = \sum_{j \in S} (c_j \cdot \boldsymbol{H_j}) + \sum_{j \notin S} (c_j \cdot \boldsymbol{H_j}) =  \boldsymbol{0}&amp;lt;/math&amp;gt;. Now consider the vector &amp;lt;math&amp;gt;\boldsymbol{c&amp;#039;}&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;c_j&amp;#039;=0&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt;j \notin S&amp;lt;/math&amp;gt;. Note &amp;lt;math&amp;gt;\boldsymbol{c&amp;#039;} \in C&amp;lt;/math&amp;gt; because &amp;lt;math&amp;gt;\boldsymbol{H} \cdot \boldsymbol{c&amp;#039;}^T = \boldsymbol{0}&amp;lt;/math&amp;gt; . Therefore, we have &amp;lt;math&amp;gt;d \le wt(\boldsymbol{c&amp;#039;}) &amp;lt;/math&amp;gt;, which is the minimum number of linearly dependent columns in &amp;lt;math&amp;gt;\boldsymbol{H}&amp;lt;/math&amp;gt;. The claimed property is therefore proven.&lt;br /&gt;
&lt;br /&gt;
== Example: Hamming codes ==&lt;br /&gt;
&lt;br /&gt;
{{main|Hamming code}}&lt;br /&gt;
&lt;br /&gt;
As the first class of linear codes developed for error correction purpose, [[Hamming code|&amp;#039;&amp;#039;Hamming codes&amp;#039;&amp;#039;]] have been widely used in digital communication systems. For any positive integer &amp;lt;math&amp;gt;r \ge 2 &amp;lt;/math&amp;gt;, there exists a &amp;lt;math&amp;gt; [2^r-1, 2^r-r-1,3]_2&amp;lt;/math&amp;gt; Hamming code. Since &amp;lt;math&amp;gt;d=3&amp;lt;/math&amp;gt;, this Hamming code can correct a 1-bit error.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example :&amp;#039;&amp;#039;&amp;#039; The linear block code with the following generator matrix and parity check matrix is a &amp;lt;math&amp;gt; [7,4,3]_2&amp;lt;/math&amp;gt; Hamming code.&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\boldsymbol{G}=\begin{pmatrix} 1&amp;amp; 0&amp;amp; 0&amp;amp; 0&amp;amp; 1&amp;amp; 1&amp;amp; 0 \\ 0&amp;amp; 1&amp;amp; 0&amp;amp; 0&amp;amp; 0&amp;amp; 1&amp;amp; 1 \\ 0&amp;amp; 0&amp;amp; 1&amp;amp; 0&amp;amp; 1&amp;amp; 1&amp;amp; 1 \\ 0&amp;amp; 0&amp;amp; 0&amp;amp; 1&amp;amp; 1&amp;amp; 0&amp;amp; 1 \end{pmatrix}   ,&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt;\boldsymbol{H}=\begin{pmatrix} 1&amp;amp; 0&amp;amp; 1&amp;amp; 1&amp;amp; 1&amp;amp; 0&amp;amp; 0 \\ 1&amp;amp; 1&amp;amp;\ 1&amp;amp; 0&amp;amp; 0&amp;amp; 1&amp;amp; 0 \\ 0&amp;amp; 1&amp;amp; 1&amp;amp; 1&amp;amp; 0&amp;amp; 0&amp;amp; 1  \end{pmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Hadamard codes ==&lt;br /&gt;
&lt;br /&gt;
{{main|Hadamard code}}&lt;br /&gt;
&lt;br /&gt;
[[Hadamard code]] is a &amp;lt;math&amp;gt;[2^r, r, 2^{r-1}]_2 &amp;lt;/math&amp;gt; linear code and is capable of correcting many errors. Hadamard code could be constructed column by column : the &amp;lt;math&amp;gt;i^{th}&amp;lt;/math&amp;gt; column is the bits of the binary representation of integer &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, as shown in the following example. Hadamard code has minimum distance &amp;lt;math&amp;gt;2^{r-1}&amp;lt;/math&amp;gt; and therefore can correct &amp;lt;math&amp;gt;2^{r-2}-1&amp;lt;/math&amp;gt; errors.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example:&amp;#039;&amp;#039;&amp;#039;  The linear block code with the following generator matrix is a &amp;lt;math&amp;gt; [8,3,4]_2&amp;lt;/math&amp;gt; Hadamard code:&lt;br /&gt;
&amp;lt;math&amp;gt;\boldsymbol{G}_\mathrm{Had}=\begin{pmatrix} 0&amp;amp; 0&amp;amp; 0&amp;amp; 0&amp;amp; 1&amp;amp;\ 1&amp;amp;1&amp;amp; 1\\ 0&amp;amp; 0&amp;amp; 1&amp;amp; 1&amp;amp; 0&amp;amp; 0&amp;amp; 1&amp;amp; 1\\ 0&amp;amp; 1&amp;amp; 0&amp;amp; 1&amp;amp; 0&amp;amp; 1&amp;amp; 0&amp;amp; 1\end{pmatrix}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Hadamard code]] is a special case of [[Reed–Muller code]]. If we take the first column (the all-zero column) out from &amp;lt;math&amp;gt;\boldsymbol{G}_\mathrm{Had}&amp;lt;/math&amp;gt;, we get &amp;lt;math&amp;gt;[7,3,4]_2&amp;lt;/math&amp;gt; &amp;#039;&amp;#039;simplex code&amp;#039;&amp;#039;, which is the &amp;#039;&amp;#039;dual code &amp;#039;&amp;#039; of Hamming code.&lt;br /&gt;
&lt;br /&gt;
==Nearest neighbor algorithm==&lt;br /&gt;
&lt;br /&gt;
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):&lt;br /&gt;
&lt;br /&gt;
Input: A &amp;#039;&amp;#039;received vector&amp;#039;&amp;#039; v in &amp;lt;math&amp;gt;\mathbb{F}_q^n.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Output: A codeword &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; closest to &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, if any.&lt;br /&gt;
&lt;br /&gt;
*Starting with &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, repeat the following two steps.&lt;br /&gt;
*Enumerate the elements of the ball of (Hamming) radius &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; around the received word &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, denoted &amp;lt;math&amp;gt;B_t(v)&amp;lt;/math&amp;gt;.&lt;br /&gt;
**For each &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;B_t(v)&amp;lt;/math&amp;gt;, check if &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;. If so, return &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt; as the solution.&lt;br /&gt;
*Increment &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. Fail only when &amp;lt;math&amp;gt;t &amp;gt; (d - 1)/2&amp;lt;/math&amp;gt; so enumeration is complete and no solution has been found.&lt;br /&gt;
&lt;br /&gt;
We say that a linear &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;-error correcting if there is at most one codeword in &amp;lt;math&amp;gt;B_t(v)&amp;lt;/math&amp;gt;, for each &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;\mathbb{F}_q^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Popular notation==&lt;br /&gt;
{{main|Block code#Popular notation}}&lt;br /&gt;
[[Code]]s in general are often denoted by the letter &amp;#039;&amp;#039;C&amp;#039;&amp;#039;, and a code of length &amp;#039;&amp;#039;n&amp;#039;&amp;#039; and of [[dimension (linear algebra)|rank]] &amp;#039;&amp;#039;k&amp;#039;&amp;#039; (i.e., having &amp;#039;&amp;#039;n&amp;#039;&amp;#039; code words in its basis and &amp;#039;&amp;#039;k&amp;#039;&amp;#039; rows in its &amp;#039;&amp;#039;generating matrix&amp;#039;&amp;#039;) is generally referred to as an (&amp;#039;&amp;#039;n&amp;#039;&amp;#039;,&amp;amp;nbsp;&amp;#039;&amp;#039;k&amp;#039;&amp;#039;) code. Linear block codes are frequently denoted as [&amp;#039;&amp;#039;n&amp;#039;&amp;#039;,&amp;amp;nbsp;&amp;#039;&amp;#039;k&amp;#039;&amp;#039;,&amp;amp;nbsp;&amp;#039;&amp;#039;d&amp;#039;&amp;#039;] codes, where &amp;#039;&amp;#039;d&amp;#039;&amp;#039; refers to the code&amp;#039;s minimum Hamming distance between any two code words.&lt;br /&gt;
&lt;br /&gt;
(The [&amp;#039;&amp;#039;n&amp;#039;&amp;#039;,&amp;amp;nbsp;&amp;#039;&amp;#039;k&amp;#039;&amp;#039;,&amp;amp;nbsp;&amp;#039;&amp;#039;d&amp;#039;&amp;#039;] notation should not be confused with the (&amp;#039;&amp;#039;n&amp;#039;&amp;#039;,&amp;amp;nbsp;&amp;#039;&amp;#039;M&amp;#039;&amp;#039;,&amp;amp;nbsp;&amp;#039;&amp;#039;d&amp;#039;&amp;#039;) notation used to denote a &amp;#039;&amp;#039;non-linear&amp;#039;&amp;#039; code of length &amp;#039;&amp;#039;n&amp;#039;&amp;#039;, size &amp;#039;&amp;#039;M&amp;#039;&amp;#039; (i.e., having &amp;#039;&amp;#039;M&amp;#039;&amp;#039; code words), and minimum Hamming distance &amp;#039;&amp;#039;d&amp;#039;&amp;#039;.)&lt;br /&gt;
&lt;br /&gt;
==Singleton bound==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Lemma&amp;#039;&amp;#039; ([[Singleton bound]]): Every linear [&amp;#039;&amp;#039;n&amp;#039;&amp;#039;,&amp;#039;&amp;#039;k&amp;#039;&amp;#039;,&amp;#039;&amp;#039;d&amp;#039;&amp;#039;] code C satisfies &amp;lt;math&amp;gt;k+d \leq n+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A code &amp;#039;&amp;#039;C&amp;#039;&amp;#039; whose parameters satisfy &amp;#039;&amp;#039;k&amp;#039;&amp;#039;&amp;amp;nbsp;+&amp;#039;&amp;#039;d&amp;#039;&amp;#039;&amp;amp;nbsp;=&amp;amp;nbsp;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;amp;nbsp;+&amp;amp;nbsp;1 is called &amp;#039;&amp;#039;&amp;#039;maximum distance separable&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;MDS&amp;#039;&amp;#039;&amp;#039;. Such codes, when they exist, are in some sense best possible.&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and &amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are two codes of length &amp;#039;&amp;#039;n&amp;#039;&amp;#039; and if there is a permutation &amp;#039;&amp;#039;p&amp;#039;&amp;#039; in the [[symmetric group]] &amp;#039;&amp;#039;S&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;lt;/sub&amp;gt; for which (&amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;,...,&amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;lt;/sub&amp;gt;) in &amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; if and only if (&amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;&amp;#039;&amp;#039;p&amp;#039;&amp;#039;(1)&amp;lt;/sub&amp;gt;,...,&amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;&amp;#039;&amp;#039;p&amp;#039;&amp;#039;(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;)&amp;lt;/sub&amp;gt;) in &amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, then we say &amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and &amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are &amp;#039;&amp;#039;&amp;#039;permutation equivalent&amp;#039;&amp;#039;&amp;#039;. In more generality, if there is an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; [[monomial matrix]] &amp;lt;math&amp;gt;M\colon \mathbb{F}_q^n \to \mathbb{F}_q^n&amp;lt;/math&amp;gt; which sends &amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; isomorphically to &amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; then we say &amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and &amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are &amp;#039;&amp;#039;&amp;#039;equivalent&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Lemma&amp;#039;&amp;#039;: Any linear code is permutation equivalent to a code which is in standard form.&lt;br /&gt;
&lt;br /&gt;
==Bonisoli&amp;#039;s theorem==&lt;br /&gt;
A code is defined to be &amp;#039;&amp;#039;&amp;#039;equidistant&amp;#039;&amp;#039;&amp;#039; if and only if there exists some constant &amp;#039;&amp;#039;d&amp;#039;&amp;#039; such that the distance between any two of the code&amp;#039;s distinct codewords is equal to &amp;#039;&amp;#039;d&amp;#039;&amp;#039;.&amp;lt;ref&amp;gt;{{cite arXiv|author=Etzion, Tuvi|author2=Raviv, Netanel|title=Equidistant codes in the Grassmannian|year=2013|eprint=1308.6231|class=math.CO}}&amp;lt;/ref&amp;gt; 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 [[w:Dual code|dual]] [[Hamming code]]s.&amp;lt;ref&amp;gt;{{cite journal|author=Bonisoli, A.|year=1984|title=Every equidistant linear code is a sequence of dual Hamming codes|journal=Ars Combinatoria|volume=18|pages=181–186}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Some examples of linear codes include:&lt;br /&gt;
{{div col|colwidth=27em}}&lt;br /&gt;
* [[Repetition code]]&lt;br /&gt;
* [[Parity code]]&lt;br /&gt;
* [[Cyclic code]]&lt;br /&gt;
* [[Hamming code]]&lt;br /&gt;
* [[Golay code (disambiguation)|Golay code]], both the [[binary Golay code|binary]] and [[ternary Golay code|ternary]] versions&lt;br /&gt;
* [[Polynomial code]]s, of which [[BCH code]]s are an example&lt;br /&gt;
* [[Reed–Solomon error correction|Reed–Solomon codes]]&lt;br /&gt;
* [[Reed–Muller code]]&lt;br /&gt;
* [[Algebraic geometry code]]&lt;br /&gt;
* [[Binary Goppa code]]&lt;br /&gt;
* [[Low-density parity-check codes]]&lt;br /&gt;
* [[Expander code]]&lt;br /&gt;
* [[Multidimensional parity-check code]]&lt;br /&gt;
* [[Toric code]]&lt;br /&gt;
* [[Turbo code]]&lt;br /&gt;
* [[Locally recoverable code]]&lt;br /&gt;
{{div col end}}&lt;br /&gt;
&lt;br /&gt;
==Generalization==&lt;br /&gt;
[[Hamming space]]s over non-field alphabets have also been considered, especially over [[finite ring]]s, most notably [[Galois ring]]s over [[modular arithmetic|&amp;#039;&amp;#039;&amp;#039;Z&amp;#039;&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;]]. This gives rise to [[module (mathematics)|module]]s instead of vector spaces and [[ring-linear code]]s (identified with [[submodule]]s) instead of linear codes. The typical metric used in this case the [[Lee distance]]. There exist a [[Gray isometry]] between &amp;lt;math&amp;gt;\mathbb{Z}_2^{2m}&amp;lt;/math&amp;gt; (i.e. GF(2&amp;lt;sup&amp;gt;2&amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;lt;/sup&amp;gt;)) with the Hamming distance and &amp;lt;math&amp;gt;\mathbb{Z}_4^m&amp;lt;/math&amp;gt; (also denoted as GR(4,m)) with the Lee distance; its main attraction is that it establishes a correspondence between some &amp;quot;good&amp;quot; codes that are not linear over &amp;lt;math&amp;gt;\mathbb{Z}_2^{2m}&amp;lt;/math&amp;gt; as images of ring-linear codes from &amp;lt;math&amp;gt;\mathbb{Z}_4^m&amp;lt;/math&amp;gt;.&amp;lt;ref name=&amp;quot;Greferath2009&amp;quot;&amp;gt;{{cite book |editor=Massimiliano Sala |editor2=Teo Mora |editor3=Ludovic Perret |editor4=Shojiro Sakata |editor5=Carlo Traverso|title=Gröbner Bases, Coding, and Cryptography|year=2009|publisher=Springer Science &amp;amp; Business Media|isbn=978-3-540-93806-4|chapter=An Introduction to Ring-Linear Coding Theory|author=Marcus Greferath}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite web|url=https://www.encyclopediaofmath.org/index.php/Main_Page|title=Encyclopedia of Mathematics|website=www.encyclopediaofmath.org}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;Lint1999&amp;quot;&amp;gt;{{cite book|author=J.H. van Lint|title=Introduction to Coding Theory|url=https://archive.org/details/introductiontoco0000lint_a3b9|url-access=registration|year=1999|publisher=Springer|isbn=978-3-540-64133-9|edition=3rd|at=Chapter 8: Codes over {{not a typo|ℤ}}&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some authors have referred to such codes over rings simply as linear codes as well.&amp;lt;ref name=&amp;quot;DoughertyFacchini2015&amp;quot;&amp;gt;{{cite book |editor=Steven Dougherty |editor2=Alberto Facchini |editor3=Andre Gerard Leroy |editor4=Edmund Puczylowski |editor5=Patrick Sole|title=Noncommutative Rings and Their Applications|chapter-url=https://books.google.com/books?id=psrXBgAAQBAJ&amp;amp;pg=PA80|year=2015|publisher=American Mathematical Soc.|isbn=978-1-4704-1032-2|page=80|chapter=Open Problems in Coding Theory|author=S.T. Dougherty |author2=J.-L. Kim |author3=P. Sole}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Decoding methods]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Bibliography===&lt;br /&gt;
* {{cite book|author1=J. F. Humphreys|author2=M. Y. Prest|title=Numbers, Groups and Codes|year=2004|publisher=Cambridge University Press|isbn=978-0-511-19420-7|edition=2nd}} Chapter 5 contains a more gentle introduction (than this article) to the subject of linear codes.&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [https://web.archive.org/web/20070927213247/http://jason.mchu.com/QCode/index.html &amp;#039;&amp;#039;q&amp;#039;&amp;#039;-ary code generator program]&lt;br /&gt;
* [http://www.codetables.de/ Code Tables: Bounds on the parameters of various types of codes], &amp;#039;&amp;#039;IAKS, Fakultät für Informatik, Universität Karlsruhe (TH)]&amp;#039;&amp;#039;. Online, up to date table of the optimal binary codes, includes non-binary codes.&lt;br /&gt;
* [http://z4codes.info/ The database of Z4 codes] Online, up to date database of optimal Z4 codes.&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Linear Code}}&lt;br /&gt;
[[Category:Coding theory]]&lt;br /&gt;
[[Category:Finite fields]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Michael Hardy</name></author>
	</entry>
</feed>