One table, three answers
transcript
Take the words lemon and melon. One table. Three rules. Three different questions.
A maximum gives the common letters. There are 3 of them, in order. Two neighbours give the deletions. That is 4. Three neighbours give the edits. That is only 2.
Lemon and melon have five letters each. Three letters appear in both, in order. They differ in two places.
Deletions cannot change a letter. So lemon needs four. Edits can replace a letter. So lemon needs two.
A maximum of two cells counts common letters. One plus the smaller of two counts deletions. One plus the smallest of three counts edits.
The cells stay the same. So does the order of filling. Only the rule on a mismatch changes.
You learn the table once. Then you reuse it for many problems. Only the rule on a mismatch changes.
Change the rule, change the question. Keep the table. Full breakdown in the lecture.