Hamming distance
Let
where we have used an Iverson bracket.
This defines a metric on
- A Hamming ball
is a closed ball under this metric. - The distance of a word from a distinguished
word is called the Hamming weight, or just weight, which sees a generalization in the linear case to Generalized Hamming weight.