For example:
The Hamming weight of a string is its Hamming distance from the zero string (string consisting of all zeros) of the same length. That is, it is the number of elements in the string which are not zero: for a binary string this is just the number of 1's, so for instance the Hamming weight of 11101 is 4.
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 this is equivalent to a xor b. The Hamming distance of binary strings is also equivalent to the Manhattan distance between two vertices in an n-dimensional hypercube, where n is the length of the words.
The Hamming distance is named after Richard Hamming, who introduced it in his fundamental paper about error-detecting and error-correcting 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.
Adapted in part from Federal Standard 1037C.
Richard W. Hamming. Error-detecting and error-correcting codes, Bell System Technical Journal 29(2):147-160, 1950.
Coding theory | Discrete mathematics
Hammingafstand | Distància de Hamming | Hamming-Abstand | Distancia de Hamming | Distance de Hamming | 해밍 거리 | Distanza di Hamming | Hammingafstand | ハミング距離 | Odległość Hamminga | Расстояние Хэмминга | Hammingin etäisyys
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Hamming distance".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world