Hamming distance

Definition
Given two squences (or strings) of symbols in an alphabet $$\mathcal{L}$$, the Hamming distance is a function that measures the number of positions for which the corresponding symbols are different, $$ \sigma(s,t)=\frac{\sum_{i=1}^{\min\{|s|,|t|\}}\sigma_{id}(s[i],t[i])}{\max\{|s|,|t|\}}, $$ where $$\sigma_{id}$$ is the identity similarity $$ \sigma_{id}(s[i],t[i])\left\{% \begin{array}{ll} 1, & \hbox{si $s[i]=t[i]$;} \\ 0, & \hbox{si $s[i]\neq t[i]$.} \\\end{array}% \right. $$