Skip to main content
1 of 4
Nick
  • 856
  • 7
  • 25

What a metric can I use to calculate the distance between words?

Let say we have a set of words of the same length, and you need to find the distance between words. In the case of binary words, one can use the Hamming distance. For example, if $a = 01101$ and $b = 00111$, then $d (a, b) = 2$.

In my case, words are formed from the alphabet $\{a, b, c, d, e\}$, the length of the alphabet is $5$, the length of each word is $4$.

In my case, an ordinal scale is applicable for letters , i.e.
$$a <b <c <d <e.$$

Examples of words: deed, aaaa, dada, cccd.

Question. What a metric can I use to calculate the distance between words?

Nick
  • 856
  • 7
  • 25