Given a universe set , the Hamming similarity for vectors is a function that measures the number of equals components, divided by the length of vectors.
where is the Identity similarity.
- HammingSim((0,1,0,1,1),(1,0,0,1,0)) = 2/5 = 0.4.
- HammingSim((a,b,a,c,b),(b,c,a,b,a)) = 1/5 = 0.2.
- HammingSim((a,b,c,d),(d,c,b,a)) = 0/4 = 0;
It is normalized.
Useful for comparing codes.