Hamming distance
Encyclopedia
|
| Tutorials | Encyclopedia | Dictionary | Directory |
|
Hamming distance
In information theory, the Hamming distance between two strings of equal length is the number of positions for which the corresponding symbols are different. Put another way, it measures the minimum number of substitutions required to change one into the other, or the number of errors that transformed one string into the other.
ExamplesThe Hamming distance between:
Special propertiesFor a fixed length n, the Hamming distance is a metric on the vector space of the words of that length, as it obviously fulfills the conditions of non-negativity, identity of indiscernibles and symmetry, and it can be shown easily by complete induction that it satisfies the triangle inequality as well. The Hamming distance between two words a and b can also be seen as the Hamming weight of a−b for an appropriate choice of the − operator. For binary strings a and b the Hamming distance is equal to the number of ones in a XOR b. The metric space of length-n binary strings, with the Hamming distance, is known as the Hamming cube; it is equivalent as a metric space to the set of distances between vertices in a hypercube graph. One can also view a binary string of length n as a vector in \mathbb{R}^n by treating each symbol in the string as a real coordinate; with this embedding, the strings form the vertices of an n-dimensional hypercube, and the Hamming distance of the strings is equivalent to the Manhattan distance between the vertices. History and applicationsThe Hamming distance is named after Richard Hamming, who introduced it in his fundamental paper about error-detecting and error-correcting codes (1950) introducing Hamming codes. It is used in telecommunication to count the number of flipped bits in a fixed-length binary word as an estimate of error, and therefore is sometimes called the signal distance. Hamming weight analysis of bits is used in several disciplines including information theory, coding theory, and cryptography. However, for comparing strings of different lengths, or strings where not just substitutions but also insertions or deletions have to be expected, a more sophisticated metric like the Levenshtein distance is more appropriate. For q-ary strings over an alphabet of size q ? 2 the Hamming distance is applied in case of orthogonal modulation, while the Lee distance is used for phase modulation. If q = 2 or q = 3 both distances coincide. Algorithm exampleThe Python function The following C function will compute the Hamming distance of two integers (considered as binary values, that is, as sequences of bits). The running time of this procedure is proportional to the Hamming distance rather than to the number of bits in the inputs. ReferencesAdapted in part from Federal Standard 1037C. Richard W. Hamming. Error Detecting and Error Correcting Codes, Bell System Technical Journal 26(2):147-160, 1950. See also
External links
af:Hammingafstand bg:?????????? ?? ?????? ca:Distŕncia de Hamming cs:Hammingova vzdálenost de:Hamming-Abstand es:Distancia de Hamming fr:Distance de Hamming ko:?? ?? hr:Hammingova udaljenost it:Distanza di Hamming he:???? ????? hu:Hamming-távolság nl:Hammingafstand ja:?????? pl:Odleg?o?? Hamminga ro:Distan?? Hamming ru:?????????? ???????? fi:Hammingin etäisyys vi:Kho?ng cách Hamming zh:???? Source: Wikipedia | The above article is available under the GNU FDL. | Edit this article
|
|
top
©2008-2009 TutorGig.com. All Rights Reserved. Privacy Statement