## DefinitionEdit

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.

## Examples Edit

- 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;

## Normalization Edit

It is normalized.

## Variations Edit

When the components of vectors are of different types, we have the Hamming similarity for tuples, and if vectors are of different lenght we have the Hamming similarity for sequences.

## Applications Edit

Useful for comparing codes.