### 5.2.17 Hamming distance

The hamdist command computes the Hamming distance between two sequences of equal lengths, which is defined to be the number of elements at same positions which do not match.

- hamdist takes two arguments:
  - s1, a vector or string.
  - s2, a vector or string.
- hamdist(s1,s2) returns the number n of characters in s1 that are different than the corresponding characters in s2.

#### Example

hamdist("cats","dogs")

3 |  |  |  |  |  |  |  |  |  |