12.07.2015 Views

Divide and Conquer Algorithms Homework 5

Divide and Conquer Algorithms Homework 5

Divide and Conquer Algorithms Homework 5

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The termination condition on the recursion is when A <strong>and</strong> B are both1 × 1 matrices.( ) ( )1 2 8 9m 2 = ×5 6 3 4( ) ( )3 4 7 8m 3 = ×7 8 2 3We need to now repeat this process for m 2 <strong>and</strong> m 3 since these matricesare not yet at your base case. This time, however, we need to generate allseven expressions so we can compute the 4 × 4 matrix multiplication. Form 2m 1 = (5 + 6 − 1)(4 − 9 + 8)= 30m 2 = 8m 3 = 6.After we get the results of the two 4 × 4 matrix multiplication for m 2 <strong>and</strong>m 3 we combine them results for c 11 :c 11 = m 2 + m( 3) ( )14 17 27 33=+55 78 63 77( ) 41 50=118 1555. How many multiplications would be performed in find the product of two64 × 64 matrices using the st<strong>and</strong>ard algorithm?C i j =64∑k=1= 64A ik B kjWe need to compute 64 2 entries. So total number is 64 3 .6. How many multiplications are required in finding the product of two 64×64matrices using the Strassen’s algorithm with 2 × 2 matrices as the basecase solved in the traditional way?This is best solved using the recurrence (we set g(n) to 0 since we are onlycounting multiplications):T (n) = 7 ∗ T ( n 2 ) + g(n)2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!