Now there are 'L' ways of parenthesizing the left sublist and 'R' ways of parenthesizing the right sublist then the Total will be L.R:Īlso p (n) = c (n-1) where c (n) is the nth Catalon number It can be observed that after splitting the kth matrices, we are left with two parenthesized sequence of matrices: one consist 'k' matrices and another consist 'n-k' matrices. No of Scalar multiplication in Case 1 will be: (A 1,A 2),A 3: First multiplying(A 1 and A 2) then multiplying and resultant withA 3.A 1,(A 2,A 3): First multiplying(A 2 and A 3) then multiplying and resultant withA 1.Three Matrices can be multiplied in two ways: It is also noticed that we can save the number of operations by reordering the parenthesis.Įxample1: Let us have 3 matrices, A 1,A 2,A 3 of order (10 x 100), (100 x 5) and (5 x 50) respectively. It can be observed that the total entries in matrix 'C' is 'pr' as the matrix is of dimension p x r Also each entry takes O (q) times to compute, thus the total time to compute all possible entries for the matrix 'C' which is a multiplication of 'A' and 'B' is proportional to the product of the dimension p q r. By this, we mean that we have to follow the above matrix order for multiplication but we are free to parenthesize the above multiplication depending upon our need. Matrix Multiplication operation is associative in nature rather commutative.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |