In [[mathematics]] and [[information theory]], a '''linear code''' is an important type of [[block code]]s used in [[error correction and detection]] schemes. The [[linearity]] of the code means that the sum of any two [[codeword]]s is a codeword. Linear codes allow for more efficient encoding and decoding algorithms (cf. [[syndrome decoding]]).
In [[mathematics]], a '''(binary) linear code''' of length <math>1 \leq n</math> and ''rank'' <math>1\leq k \leq n</math> is a [[linear subspace]] <math>C</math> with [[dimension (linear algebra)|dimension]] <math>k</math> of the [[vector space]]
==Formal definition==
:<math>\mathbb{F}^n_2</math>.
Aside:A '''linear code''' of length <math>\mathbb{F}_2n</math> and =rank \{0,1\}<math>k</math> is thea [[fieldlinear (mathematics)|fieldsubspace]] of<math>C</math> twowith [[elementdimension (mathematicslinear algebra)|elementdimension]]s and <math>\mathbb{F}^n_2k</math> isof the set of all [[n-tuplevector space]]s of length <math>{\mathbb{F}_q}^n</math> overwhere <math>\mathbb{F}_2_q</math>.Occasionallyis some otherthe [[finite field]] with <math>\mathbb{F}_qq</math> containingelements. The most important cases are when <math>q > 2</math> elements is used2 or 3, 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'' andor '''ternary'' codes (corresponding to ''q=2'' and ''q=3'', respectively).