Hamming distance
The Hamming distance between two vectors of equal length is the number of positions at which the corresponding entries differ.
In other words, it measures the minimum number of substitutions required to change one codeword into another.
Formally,
let
The Hamming Distance on
i.e. the number of positions where
The Hamming distance is a metric on the Hamming space, since it is
- non-negative,
- symmetric,
if and only if , - satisfies the triangle inequality
Hamming distance for binary codes can be calculated using the binomial coefficient.
See also
minimum Hamming distance
Hamming ball
error detection and correction