Professional Documents
Culture Documents
Slide 04b
Slide 04b
Masroor Hussain
Professor
Faculty of Computer Science and Engineering
1
2
Recursion
• Whenever a recurrence is stated without an explicit base case, we assume that the
recurrence is algorithmic.
3
Strassen’s algorithm
4
Standard Matrix Multiplication
Recap
5
Strassen’s Matrix Multiplication
6
Motivation
• For 2 × 2 matrices, there is no benefit in using the method.
• To see where this is of help, think about multiplication two
(2k) × (2k) matrices.
• For this problem, the scalar multiplications and additions
become matrix multiplications and additions.
• An addition of two matrices requires O(k2) time, a
multiplication requires O(k3).
• Hence, multiplications are much more expensive and it
makes sense to trade one multiplication operation for 18
additions.
7
Recursive Matrix Multiplication
• Here
8
Recursive Matrix
Multiplication..
T(n)=?
9
Time complexities
• Recursive Matrix Multiplication
10
Strassen’s Algorithm
11
OR …
12
Show?
13
Complexity
• T(n) = 7 T(n/2) +cn2
• The solution works out to be: T(n) = (nlg 7) = O(n2.81) by
applying master’s method.
• Currently, the best known algorithm was given by
Coppersmith and Winograd and has time complexity
O(n2.376).
14
?
15