Given the sets , let the set of -tuples with with . The Hamming similarity for tuples is a function that measures the number of equals components, divided by the length of tuples:
where is the Identity similarity.
- HammingSim((1,a,0,b),(0,a,1,b)) = 2/4 = 0.25.
- HammingSim((1,a,0,b),(0,b,1,a))= 0/4 = 0.
- HammingSim(('A.Sanchez','email@example.com','913724710'),('A.Sanchez','firstname.lastname@example.org',' ') = 1/3 = 0.33.
It is normalized.
When the components of tuples are of the same types, we have the Hamming similarity for vectors.
Useful for comparing entities described by a fixed set of attributes of different types.