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.
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)
The problem: Compute AB, where A and B are both n×n matrices and n is a...
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 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. 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 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 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 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 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...
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 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...
A. In each case, find the matrix A T [2 1 1-201)=10 5 Problem 4. a. 10.5p (A+5 B. Let A and B denote n × n invertible matrices. a. 10.5pl Show that A-1 B-1A(A+ B)B-1. a. [0.5p] İf A+ B is also invertible, show that A-1-B-1 is invertible and find a formula for (AB
A. In each case, find the matrix A T [2 1 1-201)=10 5 Problem 4. a. 10.5p (A+5 B. Let A and B denote n...