Is there such a thing as a nonlinear Hamming code?
Please give me a formal definition of Hamming code. Many that I've seen say that a Hamming code is binary, yet I've been given examples of non-binary Hamming codes.
Is there such a thing as a nonlinear Hamming code?
Please give me a formal definition of Hamming code. Many that I've seen say that a Hamming code is binary, yet I've been given examples of non-binary Hamming codes.
Hamming codes exist over any finite base field $\mathbb F_q$, and they are always linear.
Usually they are defined in the following way: A parity check matrix of the Hamming code of codimension $k$ is constructed by writing projective (= up to scalar multiples) representatives of the non-zero vectors in $\mathbb F_q^k$ into the columns of a matrix. If you take this matrix as a generator matrix, the dual of the Hamming code is generated, which is called Simplex code.
For example, for $q = 3$ and $k = 3$, there are $3^3 - 1 = 26$ non-zero vectors in $\mathbb F_3^3$, and a set of projective representatives consists of $26 / 2 = 13$ vectors. A parity check matrix of the Hamming code (and thus, a generator matrix of the Simplex code) is given by $$ \begin{pmatrix} 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & 1 & 0 & 0 & 0 & 1 & 1 & 1 & 2 & 2 & 2 \\ 1 & 0 & 1 & 2 & 0 & 1 & 2 & 0 & 1 & 2 & 0 & 1 & 2 \end{pmatrix}. $$
By the way, this question is somewhat related.