Question

The problem: Compute AB, where A and B are both n×n matrices and n is a...

The problem: Compute AB, where A and B are both n×n matrices and n is a positive integer.

The algorithms: standard matrix multiplication algorithm; a simple recursive algorithm; Strassen’s algorithm.

Your task: Explain which of these three algorithms for this problem is fastest (asymptotically, in the worstcase). Explain how it achieves a performance increase over the other algorithms.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Computing AxB, where A and B are both n×n matrices and n is a positive integer.
standard matrix multiplication algorithm = O(n3)
simple recursive algorithm = O(n3)
Strassen’s algorithm =O(nlog7) = O(n2.8074)
Therefore,Strassen’s algorithm for this problem is fastest

In simple recursive algorithm, the main component for high time complexity is 8 recursive calls.
Recurrence Relation
T(n) = 8*T(n/2) + O(n2)
on solving,Recurrence Relation we get Time complexity = O(n3)

But Strassen’s algorithm reduce the number of recursive calls to 7.
Recurrence Relation
T(n) = 7*T(n/2) + O(n2)
on solving,Recurrence Relation we get Time complexity = O(n2.8074)

Add a comment
Know the answer?
Add Answer to:
The problem: Compute AB, where A and B are both n×n matrices and n is a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write programs implementing matrix multiplication C = AB , where A is m x n and...

    Write programs implementing matrix multiplication C = AB , where A is m x n and B is n x k , in two different ways: ( a ) Compute the mk inner products of rows of A with columns of B , ( b ) Form each column of C as a linear combination of columns of A . Compare the performance of these two implementations on your computer. You may need to try fairly large matrices before the...

  • Need help!! 1) Let A, B, C, and D be the matrices defined below. Compute the...

    Need help!! 1) Let A, B, C, and D be the matrices defined below. Compute the matrix expressions when they are defined; if an expression is undefined, explain why. [2 0-1] [7 -5 A= .B -5 -4 1 C- ,D= (-5 3] [I -3 a) AB b) CD c) DB d) 3C-D e) A+ 2B 2) Let A and B be the matrices defined below. 4 -2 3) A=-3 0, B= 3 5 a) Compute AB using the definition of...

  • 3. (10%) Let C = AB, where A and B are both n by n matrices....

    3. (10%) Let C = AB, where A and B are both n by n matrices. The element located at row i and column of C is represented by C, and computed as C, = A, B, + A,B2, + ... + 4,B, a) Express C, using the X (summation) notation. b) Evaluate c, if Ak = 2 and B, = 3 for all k, k = 1,2,...n.

  • I already solved part A and I just need help with part B 1. Matrix Multiplication...

    I already solved part A and I just need help with part B 1. Matrix Multiplication The product of two n xn matrices X and Y is a third n x n matrix 2 = XY, with entries 2 - 21; = xixYk x k=1 There are n’ entries to compute, each one at a cost of O(n). The formula implies an algorithm with O(nº) running time. For a long time this was widely believed to be the best running...

  • Let A and B be n by n matrices and suppose that tr(AB)=0. Which of the...

    Let A and B be n by n matrices and suppose that tr(AB)=0. Which of the following statements can you infer about A and B? Select one: a. At least one of the matrices A and B must equal the zero matrix O b. A must equal the zero matrix O c. B must equal the zero matrix O d. Both A and B must equal the zero matrix e. AB must equal the zero matrix O f. None of...

  • 1 For n × p and p × m matrices, A and B write a pseudocode to compute the matrix product C AB and perform flop count. dik0kj に! 1 For n × p and p × m matrices, A and B write a pseudocode to com...

    1 For n × p and p × m matrices, A and B write a pseudocode to compute the matrix product C AB and perform flop count. dik0kj に! 1 For n × p and p × m matrices, A and B write a pseudocode to compute the matrix product C AB and perform flop count. dik0kj に!

  • Question 1. Solving Recursive Relations [3 mark]. A naive multiplication of two matrices of order n...

    Question 1. Solving Recursive Relations [3 mark]. A naive multiplication of two matrices of order n requires O(nᵒ) additions. By using a divide and conquer approach, Strassen devised another algorithm that requires T(n) additions where T(n) = 7T(n/2)+cna, where c is a constant independent of n and T(1) = 0 (as multiplying two numbers re- quires no additions). Use the method of backward substitution (introduced in Week 2's lecture) to show that Strassen’s algorithm requires O(nlog27) = O(n2.81) additions, which...

  • The goal in this assignment is to perform various matrix multiplications. Input matrices A and B...

    The goal in this assignment is to perform various matrix multiplications. Input matrices A and B are read from a file. Output matrices A*A, A*B, B*A and B*B are written to file. -Ask the user to enter the input and output file names. -Read the input data matrices A and B from the input file. (A sample input file is shown in Appendix A)             -Read the number of rows n.             -Read matrix A, which has n rows and...

  • 3. Let Y ~ N(aln, σ21n) and matrices B and A be such that BY and...

    3. Let Y ~ N(aln, σ21n) and matrices B and A be such that BY and (n-1)s-YAY (a) Show that B = n-11, and A = 1-n-J where I is the identity matrix and J is the matrix of all ones (b) Show that A is idempotent. (c) Show that tr(A)- rank(A). ( d ) Compute AB .

  • Algebra We know that matrix multiplication is not commutative: if A and B are square matrices of ...

    Algebra We know that matrix multiplication is not commutative: if A and B are square matrices of the same size, AB and BA are usually different We say that A and B commute if it so happens that AB BA. Determine all numbers a, b, e, d, such that the matrix com- mutes with both Calculus An object with mass m is dragged along a horizontal plane by a force acting along a rope attached to the object as shown...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT