Given two squences (or strings) of symbols in an alphabet , the Hamming similarity is a function that measures the number of positions for which the corresponding symbols are equals, divided by the length of the bigest sequence:
where is the Identity similarity.
- HammingSim('house','horse') = 4/5 = 0.8.
- HammingSim('abcd',' ') = 0/4 = 0.
- HammingSim('abcd','a') = 1/4 = 0.25.
- HammingSim('abcd','b') = 0/4 = 0.
- HammingSim('id0345','id1352') = 3/6 = 0.5.
It is normalized.
- Comparing codes.