3 - Computer Science C73 Scarborough Campus Homework...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science C73 October 24 2007 Scarborough Campus University of Toronto Homework Assignment #3 Due: November 7 2007, by 12 noon (in the course drop box) Appended to this document is a cover page for your assignment. Fill it out, staple your answers to it, and deposit the resulting document into the course drop box. Please do not enclose your assignment in an envelope. Question 1. (10 marks) Recall the dynamic programming algorithm to compute the edit distance of two strings discussed in class (and in KT 6.7). Suppose the two input strings are “SNOOP” and “LOOPY”. a. Show the two-dimensional array of values computed by the algorithm when Fnding the edit distance of these strings. b. Draw the DAG of subproblems solved in this example, and label each edge with 1 (if it corresponds to extending an alignment by inserting, deleting, or changing a letter), or 0 (if it corresponds to extending an alignment by matching letters). Identify a shortest path in this DAG from the node corresponding to the smallest subproblem solved (computing the edit distance between the empty string and the empty string) to the node corresponding to the largest subproblem solved (computing the edit distance between “SNOOP” and “LOOPY”). c. Suppose we want to output a shortest sequence of editing operations (of the form insert X, delete X, or change X to Y, where X and Y are letters) that transforms the Frst string to the second. Explain how this sequence can be derived from the shortest path that you identiFed in part (b). Question 2.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/10/2009 for the course RLG 100 taught by Professor Pearly during the Spring '08 term at University of Toronto- Toronto.

Page1 / 3

3 - Computer Science C73 Scarborough Campus Homework...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online