Information and communication theory, circuits Definition
Hamming distance
Builds on AlphabetStringMetric space
Remarks
Example: , since the strings differ exactly in positions and .
Non-example: the strings and have no Hamming distance, because the definition needs strings of the same length. Their edit distance, which also allows insertions and deletions, is .
The function is a metric on .
The triangle inequality holds because each position where and differ is a position where and differ or where and differ.
For binary strings, is the number of ones in , the coordinatewise sum modulo .
In Mathlib the notion is hammingDist.
Reading path
To understand this page from the ground up, read these 18 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Alphabet concept
- Element definition
- Proposition concept
- Real numbers object
- String concept
- Set definition
- Implication definition
- Predicate definition
- Ordered pair definition
- Existential quantifier definition
- Universal quantifier definition
- Cartesian product definition
- Subset definition
- Uniqueness quantifier definition
- Binary relation definition
- Function definition
- Metric space definition
- Hamming distance definition
Where this leads
6 pages build on this one.
Further reading
About this page
| Tag | K5287V64FH |
|---|---|
| URI | m2://K5287V64FH |
| Kind | definition |
| Writing | W0 stub |
| MSC | 94B05, 68R15, 68P30 |
| Defines | Hamming distance |
| Uses | Alphabet, String, Metric space |
| Changed | 3 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.