Hamming bound

From HandWiki
Revision as of 16:23, 6 February 2024 by Wikisleeper (talk | contribs) (linkage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Limit on the parameters of a block code

In mathematics and computer science, in the field of coding theory, the Hamming bound is a limit on the parameters of an arbitrary block code: it is also known as the sphere-packing bound or the volume bound from an interpretation in terms of packing balls in the Hamming metric into the space of all possible words. It gives an important limitation on the efficiency with which any error-correcting code can utilize the space in which its code words are embedded. A code that attains the Hamming bound is said to be a perfect code.

Background on error-correcting codes

An original message and an encoded version are both composed in an alphabet of q letters. Each code word contains n letters. The original message (of length m) is shorter than n letters. The message is converted into an n-letter codeword by an encoding algorithm, transmitted over a noisy channel, and finally decoded by the receiver. The decoding process interprets a garbled codeword, referred to as simply a word, as the valid codeword "nearest" the n-letter received string.

Mathematically, there are exactly qm possible messages of length m, and each message can be regarded as a vector of length m. The encoding scheme converts an m-dimensional vector into an n-dimensional vector. Exactly qm valid codewords are possible, but any one of qn words can be received because the noisy channel might distort one or more of the n letters when a codeword is transmitted.

Statement of the bound

Preliminary definitions

An alphabet set [math]\displaystyle{ \mathcal{A}_q }[/math] is a set of symbols with [math]\displaystyle{ q }[/math] elements. The set of strings of length [math]\displaystyle{ n }[/math] on the alphabet set [math]\displaystyle{ \mathcal{A}_q }[/math] are denoted [math]\displaystyle{ \mathcal{A}_q^n }[/math]. (There are [math]\displaystyle{ q^n }[/math] distinct strings in this set of strings.) A [math]\displaystyle{ q }[/math]-ary block code of length [math]\displaystyle{ n }[/math] is a subset of the strings of [math]\displaystyle{ \mathcal{A}_q^n }[/math], where the alphabet set [math]\displaystyle{ \mathcal{A}_q }[/math] is any alphabet set having [math]\displaystyle{ q }[/math] elements. (The choice of alphabet set [math]\displaystyle{ \mathcal{A}_q }[/math] makes no difference to the result, provided the alphabet is of size [math]\displaystyle{ q }[/math].)

Defining the bound

Let [math]\displaystyle{ \ A_q(n,d) }[/math] denote the maximum possible size of a [math]\displaystyle{ q }[/math]-ary block code [math]\displaystyle{ \ C }[/math] of length [math]\displaystyle{ n }[/math] and minimum Hamming distance [math]\displaystyle{ d }[/math] between elements of the block code (necessarily positive for [math]\displaystyle{ q^n \gt 1 }[/math]).

Then, the Hamming bound is:

[math]\displaystyle{ \ A_q(n,d) \leq \frac{q^n}{\sum_{k=0}^t \binom{n}{k}(q-1)^k} }[/math]

where

[math]\displaystyle{ t=\left\lfloor\frac{d-1}{2}\right\rfloor. }[/math]

Proof

It follows from the definition of [math]\displaystyle{ d }[/math] that if at most

[math]\displaystyle{ t = \left\lfloor\frac{1}{2}(d-1)\right\rfloor }[/math]

errors are made during transmission of a codeword then minimum distance decoding will decode it correctly (i.e., it decodes the received word as the codeword that was sent). Thus the code is said to be capable of correcting [math]\displaystyle{ t }[/math] errors.

For each codeword [math]\displaystyle{ c \in C }[/math], consider a ball of fixed radius [math]\displaystyle{ t }[/math] around [math]\displaystyle{ c }[/math]. Every pair of these balls (Hamming spheres) are non-intersecting by the [math]\displaystyle{ t }[/math]-error-correcting property. Let [math]\displaystyle{ m }[/math] be the number of words in each ball (in other words, the volume of the ball). A word that is in such a ball can deviate in at most [math]\displaystyle{ t }[/math] components from those of the ball's centre, which is a codeword. The number of such words is then obtained by choosing up to [math]\displaystyle{ t }[/math] of the [math]\displaystyle{ n }[/math] components of a codeword to deviate to one of [math]\displaystyle{ (q-1) }[/math] possible other values (recall, the code is [math]\displaystyle{ q }[/math]-ary: it takes values in [math]\displaystyle{ \mathcal{A}_q^n }[/math]). Thus,

[math]\displaystyle{ m = \begin{matrix} \sum_{k=0}^t \binom{n}{k}(q-1)^k \end{matrix}. }[/math]

[math]\displaystyle{ A_q (n,d) }[/math] is the (maximum) total number of codewords in [math]\displaystyle{ C }[/math], and so, by the definition of [math]\displaystyle{ t }[/math], the greatest number of balls with no two balls having a word in common. Taking the union of the words in these balls centered at codewords, results in a set of words, each counted precisely once, that is a subset of [math]\displaystyle{ \mathcal{A}_q^n }[/math] (where [math]\displaystyle{ |\mathcal{A}_q^n| = q^n }[/math] words) and so:

[math]\displaystyle{ A_q(n,d) \times m = A_q(n,d) \times \begin{matrix} \sum_{k=0}^t \binom{n}{k}(q-1)^k \end{matrix} \leq q^n. }[/math]

Whence:

[math]\displaystyle{ A_q(n,d) \leq \frac{q^n}{ \begin{matrix} \sum_{k=0}^t \binom{n}{k}(q-1)^k \end{matrix}}. }[/math]

Covering radius and packing radius

Main page: Delone set

For an [math]\displaystyle{ A_q(n,d) }[/math] code C (a subset of [math]\displaystyle{ \mathcal{A}_q^n }[/math]), the covering radius of C is the smallest value of r such that every element of [math]\displaystyle{ \mathcal{A}_q^n }[/math] is contained in at least one ball of radius r centered at each codeword of C. The packing radius of C is the largest value of s such that the set of balls of radius s centered at each codeword of C are mutually disjoint.

From the proof of the Hamming bound, it can be seen that for [math]\displaystyle{ t\,=\,\left\lfloor\frac{1}{2}(d-1)\right\rfloor }[/math], we have:

st and tr.

Therefore, sr and if equality holds then s = r = t. The case of equality means that the Hamming bound is attained.

Perfect codes

Codes that attain the Hamming bound are called perfect codes. Examples include codes that have only one codeword, and codes that are the whole of [math]\displaystyle{ \scriptstyle\mathcal{A}_q^n }[/math]. Another example is given by the repeat codes, where each symbol of the message is repeated an odd fixed number of times to obtain a codeword where q = 2. All of these examples are often called the trivial perfect codes. In 1973, Tietäväinen proved[1] that any non-trivial perfect code over a prime-power alphabet has the parameters of a Hamming code or a Golay code.

A perfect code may be interpreted as one in which the balls of Hamming radius t centered on codewords exactly fill out the space (t is the covering radius = packing radius). A quasi-perfect code is one in which the balls of Hamming radius t centered on codewords are disjoint and the balls of radius t+1 cover the space, possibly with some overlaps.[2] Another way to say this is that a code is quasi-perfect if its covering radius is one greater than its packing radius.[3]

See also

Notes

  1. Tietäväinen 1973.
  2. McWilliams and Sloane, p. 19
  3. Roman 1992, p. 140

References