Homework 5

# Homework 5 - if it is either a single matrix or the product...

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

CS180 Winter 2011 Homework 5 Due: 2/9 When submitting your homework, please include your name at the top of each page. If you submit multiple pages, please staple them together . We also ask that you do something to indicate which name is your last name on the ﬁrst page, such as underlining it. Please submit your solutions with the problems solved in the order they are given. 1. From book, Exercise 28 on page 203. 2. From book, Exercise 5 on pg 317. 3. From book, Exercise 13 on pg 324. 4. We are given a sequence ( A 1 ,A 2 ,...A n ) of n matrices to be multiplied, and we wish to compute the product A 1 A 2 ...A n . We can evaluate the expression using standard algorithm for multiplying pairs of matrices as a subroutine once we have parenthesized it to resolve all ambiguities in how the matrices are multiplied together. A product of matrices is fully parenthesized
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if it is either a single matrix or the product of two fully parenthesized matrix products, surrounded by parentheses. Matrix multiplication is associative and so all parenthesizations yield the same product. For example, sequence ( A 1 ,A 2 ,A 3 ,A 4 ) can be parenthesized in the following ways-( A 1 ( A 2 ( A 3 A 4 ))) ( A 1 (( A 2 A 3 ) A 4 )) (( A 1 A 2 )( A 3 A 4 )) (( A 1 ( A 2 A 3 )) A 4 ) ((( A 1 A 2 ) A 3 ) A 4 ) The way we parenthesize a chain can have a dramatic impact on the cost of evaluating the product. Problem Given a sequence ( A 1 ,A 2 ,...A n ) of n matrices, where ∀ i ∈ { 1 , 2 ...n } , matrix A i has dimensions p i-1 × p i , fully parenthesize the product ( A 1 A 2 ...A n ) in a way that minimizes the number of scalar multiplication when evaluating the matrix product....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online