What is the Levenstein distance between "xxx" and "yyy"?

In my opinion 6.

Converting "xxx" to "yyy" requires a total of six insertion and deletion operations: delete x and insert y, three times.

Even according to the formula we had in the lecture



lcs(a, b) "longest common substring" -> length of the longest common substring that can be obtained by deleting characters



However, ChatGPT thinks it's 3 and won't change its mind. Am I making a mistake, or is the AI ​​wrong?

(3 votes)
Loading...

Similar Posts

Subscribe
Notify of
6 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
GWEckenberg
2 months ago

Tell you how he can do it in 3 operations.

ChatGPT is great, but as it says: it also makes mistakes.

Toddy4711
2 months ago

Replacement is an independent operation with distance 1 and must not be mapped by inserting and deleting.

Toddy4711
2 months ago
Reply to  naitram22

Well, she makes sense for the LCS distance, but not for the Levenshtein distance. Levenshtein has more surgery. See also https://en.wikipedia.org/wiki/Edit_distance

Toddy4711
2 months ago
Reply to  naitram22

Exactly