Activity 4.2.
(a)
Using the allowable operations, change the word “green” into the word “grease”. Specifically identify each operation you use. (Note: the intermediate strings of letters do not have to form recognizable words.) How many operations did you use?
(b)
If it took three operations to transform “green” into “grease”, we could say that the distance between “green” and “grease” is at most 3. However, it may be possible to transform “green” into “grease” in fewer than 3 operations, which might change our opinion of the distance between these words. In general, to define the Levenshtein distance between a sting and a string let denote the number of deletions, the number of insertions, and the number of substitutions we use to get from to There may be many different combinations of and that get us from to so we want the smallest number. Prove that the Levenshtein distance function is really a metric on the set of all possible words (sensical or nonsensical).