The third metric or distance function that was encountered in this example is the Hamming distance. The Hamming distance measures the number of character changes that are needed to transform a given string to another.