Hamming similarity for vectors

Definition
Given a universe set $$E$$, the Hamming similarity for vectors is a function $$HammingSim:E^n\times E^n\longrightarrow [0,1]$$ that measures the number of equals components, divided by the length of vectors.

$$ HammingSim(s,t)=\frac{\sum_{i=1}^{n}IdSim(s[i],t[i])}{n}, $$

where $$IdSim$$ is the Identity similarity.

Examples

 * 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
It is normalized.

Variations
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
Useful for comparing codes.