{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Take Home Test 1

# Take Home Test 1 - W08/CS5592 TEST ONE Design and Analysis...

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

W08/CS5592 TEST ONE Design and Analysis of Algorithms Feb. 27, 2008, Wednesday, 7:00-8:15pm The following are three take home problems 1 Let A and B be two n × n matrices. It is well known that direct computing the product C = AB needs θ ( n 3 ) multiplications and additions. Strassen’s algorithm can do better. The following is the algorithm: Strassen’s algorithm (A, B, n ) ; Step 1. Divide each matrix into four smaller matrices: A = A A A A 22 21 12 11 and B = B B B B 22 21 12 11 , where A ij and B ij are n /2 × n /2 matrices. Step 2. Compute the following matrices: P = ( A 11 + A 22 )( B 11 + B 22 ); Q = ( A 21 + A 22 ) B 11 ; R = A 11 ( B 12 - B 22 ); S = A 22 ( B 21 - B 11 ); T = ( A 11 + A 22 ) B 22 ; U = ( A 21 - A 11 )( B 11 + B 12 ); V = ( A 12 - A 22 )( B 21 + B 22 ); Step 3. Compute the following matrices: C 11 = P + S T + V ; C 12 = R + T ; C 21 = Q + S ; C 22 = P + R Q + U ; Step 4. Output the answer: AB = C C C C 22 21 12 11 . Please determine the time complexity of the Strassen’s algorithm. You need only to show the order and you can assume n = 2 k . Also, you need NOT to worry about the

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

Take Home Test 1 - W08/CS5592 TEST ONE Design and Analysis...

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

View Full Document
Ask a homework question - tutors are online