Question: Solve this C language problem ( c ) ( 5 points ) Suppose the recursive calls on lines 2 0 - 2 3 are replaced

Solve this C language problem (c)(5 points) Suppose the recursive calls on lines 20-23 are replaced with the following
code:float M2[]= matmul(A21+ A22, B11, N/2);
float M3[]= matmul(A11, B12- B22, N/2);
float M4[]= matmul(A22, B21- B11, N/2);
float M5[]= matmul(A11+ A12, B22, N/2);
float M6[]= matmul(A21- A11, B11+ B12, N/2);
float M7[]= matmul(A12- A22, B21+ B22, N/2);and the return statement on line 25 is replaced with:
return [[M1+ M4- M5+ M7, M3+ M5],
[M2+M4,M1-M2+M3+M6]
Note that this computes the same result! Use big- notation to express the new
number of float/float multiplies in terms of the size N.(Hint: write a new recurrence
relation).
Consider the following pseudocode that recursively multiplies two NN matrices by
breaking them into eight N2N2 matrix multiplies:// base case return [A[0,0]* B [0,0]];// get A submatricesfloat A12[]= A[:N/2, N/2:];float A22[]= A[N/2:,N/2:];float B11[]= B[:N/2, :N/2];float B21[]= B[N/2:, :N/2];// make recursive callsfloat C12[]= matmul(A12, B22, N/2)+ matmul(A11, B12, N/2);float C22[]= matmul(A21, B12, N/2)+ matmul(A22, B22, N/2);}For simplicity, you may assume that N is a power of two.
(a)(3 points) Write a recurrence relation that describes the number of times the above
algorithm multiplies two floats (line 4) as a function of N.
(b)(2 points) Use the Master Theorem to compute a big- closed form of your recur-
rence relation from part (a). Show all intermediate steps.
 Solve this C language problem (c)(5 points) Suppose the recursive calls

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!