# hwk3 - tiplication problem Look for the two contiguous...

This preview shows page 1. Sign up to view the full content.

Spring 2011 CMSC 451: Homework 3 Clyde Kruskal Due at the start of class Tuesday, October 25, 2011. Problem 1. Do Exercise 2 on page 246 of Kleinberg and Tardos. Problem 2. Do Exercise 3 on pages 246-7 of Kleinberg and Tardos. Problem 3. Assume we measure the distance between points in the plane using Manhattan Distance , where the distance between points ( x 1 ,y 1 ) and ( x 2 ,y 2 ) is | x 1 - x 2 | + | y 1 - y 2 | . Modify the closest-pair of points algorithm for this alternative method of measuring distance. Problem 4. Show that you can multiply matrices in O ( n lg 7 ) time even if n is not a power of 2. Problem 5. Consider the following greedy algorithm for solving the chained matrix mul-
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: tiplication problem: Look for the two contiguous matrices that can be multiplied the fastest and multiply them. Continue like this until Fnished. (More formally, let the dimensions for matrices A 1 ,...,A n , be given by the sequence < p ,p 1 ,...,p n > . Look for the two contiguous matrices A i and A i +1 whose multi-plication minimizes the product p i-1 p i p i +1 . Substitute p i-1 ,p i +1 for p i-1 ,p i ,p i +1 in p . Continue like this until p consists of only two values.) Show that this greedy algorithm does not necessarily Fnd the optimal way to multiply a chain of matrices....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online