Algorithms in the Real World (15853), Fall 09
Assignment #5
Due: Nov 12
You can look up material on the web and books, but you cannot look up solutions to the given
problems. You can work in groups, but must write up the answers individually.
Problem 1: Solving a Recurrence (5pt)
For the spaceefficient Edit Distance problem (Lecture 3), we used the recurrence:
T
(
n, m
)
=
T
(
n/
2
, k
) +
T
(
n/
2
, m

k
) +
O
(
mn
)
T
(1
, m
)
=
m
T
(
n,
1)
=
n
Give a formal proof that
T
(
m, n
) =
O
(
mn
)
.
Problem 2: 10pt
Given two strings
S
1
and
S
2
and a text
T
, you want to find whether there is an occurrence of
S
1
and
S
2
interwoven in
T
, possibly with spaces. For example, the strings
abac
and
bbc
occur inter
woven in
cabcbabcca
. Give an efficient algorithm for this problem (i.e. one that is polynomial
in the size of the inputs).
Problem 3: 10pt
Consider the following gap model – each insertion or deletion costs a unit. However, if there are
more than
k
consecutive insertions, or
k
consecutive deletions, they cost only
k
units. Give an
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '09
 GuyBlelloch
 Algorithms, Graph Theory, Shortest path problem, edit distance, edit distance problem, Myers & Ukkonen

Click to edit the document details