In mathematics, a (binary) linear code of length and rank is a linear subspace with dimension of the vector space
- .
Aside: is the field of two elements and is the set of all n-tuples of length over . Occasionally some other finite field containing 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 , the sum of two codewords in is also a codeword (ie an element of the subspace ). Thus the entire code (which may be very large) to be represented as the span of a minimal set of codewords (known as a 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 .
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:
implying:
The motivation behind creating linear codes is to allow for syndrome decoding.
Popular notation
Codes in general are often denoted by the letter . A linear code of length , rank (ie having codewords in its basis and rows in its generating matrix) and minimum Hamming weight is referred to as an code.
Remark. This is not to be confused with the notation to denote a non-linear code of length , size (ie having codewords) and minimum Hamming distance .