A '''linear code''' of length <math>''n</math>'' and rank <math>''k</math>'' is a [[linear subspace]] <math>''C</math>'' with [[dimension (linear algebra)|dimension]] <math>''k</math>'' of the [[vector space]] <math>{\mathbb{F}_q}^n</math> where <math>\mathbb{F}_q</math> is the [[finite field]] with <math>''q</math>'' elements. Such a code with parameter <math>''q</math>'' is called a ''q''-ary code (ege.g., when <math>''q'' = 5</math>, the code is a 5-ary code). Notable exceptions to this are the cases <math>''q'' = 2</math> and <math>''q'' = 3</math>, when the code is described as binary and ternary (respectively).