In [[mathematics]], a '''(binary) linear code''' of length ''n''<math>1 \leq n</math> 0 and ''rank'' 0 <math>1\leq ''k''<\leq ''n'' + 1</math> is a [[linear subspace]] ''<math>C''</math> with [[dimension (linear algebra)|dimension]] ''<math>k''</math> of the [[vector space]]
:<math>\mathbb{F}^n_2.</math>.
Aside: ''F''<sub>2</submath>\mathbb{F}^n_2 = \{0,1\}</math> is the [[field (mathematics)|field]] withof two [[element (mathematics)|element]]s and <math>\mathbb{F}^n_2</math> is the set of all [[n-tuple]]s of length ''<math>n''</math> over ''F''<submath>2\mathbb{F}_2</submath>. Occasionally some other [[finite field]] ''F''<submath>q\mathbb{F}_q</submath> containing ''<math>q'' > 2</math> elements is used, in which case the code is said to be a "''q''-ary" code (rather than a binary code). Special exceptions to the general [[adjective]] '"q-ary'" are ''binary'' and ''ternary'' codes (corresponding to ''q=2'' and ''q=3'' respectively).
==Properties==
By virtue of the fact that the code is a [[subspace]] of ''F''<supmath>''n''\mathbb{F}^n_2</supmath>, the sum ''c<sub>1</submath>c_1 + c<sub>2c_2</submath>'' of two codewords in ''<math>C''</math> is also a codeword (ie an [[element (mathematics)|element]] of the subspace ''<math>C''</math>). Thus the entire code (which may be very large) to be represented as the [[span (linear algebra)|span]] of a minimal set of codewords (known as a [[basis (linear algebra)|basis]] in [[linear algebra]] terms). These basis codewords are often collated in the rows of a matrix known as a ''generating matrix'' for the code ''<math>C''</math>.
The subspace definition also gives rise to the important property that the minimum [[Hamming distance]] between codewords is simply the minimum [[Hamming weight]] of all codewords since:
Line 21:
==Popular notation==
[[Code]]s in general are often denoted by the letter ''<math>C''</math>. A linear code of length ''<math>n''</math>, [[dimension (linear algebra)|rank]] ''<math>k''</math> (ie having ''<math>k''</math> codewords in its basis and ''<math>k''</math> rows in its ''generating matrix'') and minimum Hamming weight ''<math>d''</math> is referred to as an <math>(''n''.'',k'',''d'')</math> code.
'''Remark.''' This is not to be confused with the notation <math>[''n'',''r'',''d'']</math> to denote a non-linear code of length ''<math>n''</math>, size ''<math>r''</math> (ie having ''<math>r''</math> codewords) and minimum Hamming distance ''<math>d''</math>.