Hamming Space

Let \(Q\) be the finite set of \(q\) elements called the alphabet. Subsets of \(Q^n\) are called codes.

On \(Q^n\), we can define a metric called the Hamming distance metric \(d:Q^n \times Q^n \rightarrow \mathbb{N}^{\ge 0}\) as the following one. For any \(x,y \in Q^n\) such that \(x = (x_1, x_2, \dots ,x_n)\) and \(y = (y_1, y_2, \dots ,y_n)\)

\[\begin{equation} d(x,y) : = \# \{ i\ |\ x_i \neq y_i\}, \label{eq:defi_of_generald} \end{equation}\] where for any finite set \(S\) the notations \(|S|\) or \(\#S\) are used denote its cardinality (i.e. number of elements).

This space is called the Hamming space. If \(Q\) is the ring \(\mathbb{Z}/q\mathbb{Z}\), we can define the Fourier transform on it.

Weight of a codeword

Many times however, instead of a general set \(Q\), we may demand that \(Q\) to be the ring \(\mathbb{Z}/q\mathbb{Z}\) or the finite field \(\mathbb{F}_q\) (and hence \(q= |Q|\) should be some power of a prime number). In both of these cases, one can define the of a codeword in \(Q^n\) as the value of the weight function \(w:Q^n \rightarrow \mathbb{N}^{\ge 0}\), which for an \(x = (x_1, x_2, \dots ,x_n) \in {Q}^n\) is given by the size of its support (set of non-zero coordinates), i.e.

\[\begin{equation} w(x): = \#\{ i\ | \ x_i \neq 0\}. \label{eq:defi_of_w} \end{equation}\]

Using this notion of a weight, we can express the Hamming metric on \(Q^n\) for \(x,y \in \mathbb{F}_q^n\) as

\[\begin{equation} d(x,y) = w(x-y). \label{eq:defi_of_d} \end{equation}\]


This page was updated on February 25, 2022.
Main Page