Question: 5. Application: Matrix Multiplicatioin (a) Consider the code below for easy-multiply, which computes the matrix prod- uct of two n n square matrices of floating-point

 5. Application: Matrix Multiplicatioin (a) Consider the code below for easy-multiply,

5. Application: Matrix Multiplicatioin (a) Consider the code below for easy-multiply, which computes the matrix prod- uct of two n n square matrices of floating-point numbers. Suppose that all primitive operations (*, +,, ) are (1) operations. Provide a tight asymp- totic upper bound on the runtime of easy-multiply in terms of n. (*) Algorithm 1: easy-multiply(A, B) Data: Two n x n, 2-D Arrays A and B of floating point numbers Result: The matrix product AB Result an n n matrix of zeroes for i - 1 to n do (Note: This operation takes (n2) time) for i-1 to n do for k = 1 to n do Result ili] A i][k] B[k][j] end end end return Result (b) Strassen Matrix Multiplication is an algorithm for matrix multiplication which achieves a runtime asymptotically bounded by 0(n2807) on n n matrices. De- spite this good runtime bound, this algorithm is slower than easy-multiply on small inputs. Call the routine for Strassen matrix multiplication s-multiply. Consider the following algorithm for matrix multiplication: Algorithm 2: combined-multiply(A, B) Data: Two n n, 2-D Arrays A and B of floating point numbers Result: The matrix product AB if n 100 then | return easy-multiply(A, B) else |return s-multiply(A, B) end What is the asymptotic runtime of combined-multiply in terms of n? (*) 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!