Compute the minimal Levenshtein edit distance for the following pairs of sequences.
\[\begin{align} S_{1} = A\\ S_{2} = T \end{align}\]
A → T
A → T = 1
\[\begin{align} S_{1} &= AGATATA\\ S_{2} &= TATATATA \end{align}\]
AGATATA → ATATATA → …
AGATATA → ATATATA → TATATATA = 2
\[\begin{align} S_{1} = AGTCCT\\ S_{2} = CGCTCA \end{align}\]
AGTCCT → AGCTCA → …
AGTCCT → CGTCCT → CGCCCT → CGCTCT → CGCTCA = 4
\[\begin{align} S_{1} = TGCATAT\\ S_{2} = ATCCGAT \end{align}\]
TGCATAT → AGCATAT → …
TGCATAT → AGCATAT → ATCATAT → ATCAGAT → ATCCGAT = 4
\[\begin{align} S_{1} = ACGTATATAGCCCCGCG\\ S_{2} = ACGTTATATAGCCGCGC \end{align}\]
You need to use all the possible operations
ACGTATATAGCCCCGCG → ACGTTATATAGCCCCGCG → …
ACGTATATAGCCCCGCG → ACGTTATATAGCCCCGCG → ACGTTATATAGCCGCGCG → ACGTTATATAGCCGCGC = 3
Check if the corresponding functions are metric.
\[\begin{align} w(x,y) = x-y \end{align}\]
What if \(x = 1\) and \(y = 2\)?
Not a metric, violates symmetry constraint.
\[ x = 1\\ y = 2\\ x - y = 1 - 2 = -1 \neq 1 = 2 - 1 = y - x \]
\[\begin{align} w(x,y) = |x-y| \end{align}\]
You need to check all the properties.
Metric
\[\begin{align} w(x,y) = x+y \end{align}\]
What if \(x = 1\) and \(y = 1\)?
Not metric, violates identity constraint:
\[ x = y = 1\\ x + y = x + x = 2 \neq 0 \]
\[\begin{align} w(x,y) = \begin{cases} 1 \ \text{if}\ x \neq y \\0\ \text{else} \end{cases} \end{align}\]
You need to check all the properties.
Metric
Programming assignments are available via Github Classroom and contain automatic tests.
We recommend doing these assignments since they will help you to further understand this topic.
Access the Github Classroom link: Programming Assignment: Sheet 02.