edited by
15,465 views
5 votes
5 votes
Total no. of ways to perform matrix multiplication having 7 matrices is ?

Total no. of ways to by which we  could parenthesize 7 matrices is ?

Does the above two questions are different or same ?

Plz explain the answer.
edited by

5 Answers

Best answer
10 votes
10 votes

Both are same questions.

Let's solve the question.

1. if there are two matrices A & B, there are only 1 way to multiply them as AxB
2. If there are three matrices A, B and C then there are 2 ways as (A(BC)) and ((AB)C)
3. If there are 4 matrices A,B,C and D then
 (A(BCD)) = 2 ways, as three matrices B, C, & D can be multiplied 2 ways as shown above.
OR
((AB)(CD)) = 1 way
OR
((ABC)D) = 2 ways
there are total 5 ways to multiply 4 matrices.
4. If there are 5 matrices A, B, C, D and E then
(A(BCDE)) = 5 ways
((AB)(CDE)) = 2 ways
((ABC)(DE)) = 2 ways
((ABCD)E)) = 5 Ways
total = 14 ways.
5. If there are 6 matrices A,B,C,D,E and F then
(A(BCDEF)) = 14 ways
((AB)(CDEF)) = 5 ways
((ABC)(DEF)) = 2x2 = 4 ways
((ABCD)(EF)) = 5 ways
((ABCDE)F) = 14 ways
total = 14 + 5 + 4 + 5 +14 = 42 ways.

6. if there are 7 matrices, A,B,C,D,E,F, and G then
(A(BCDEFG)) = 42 ways
((AB(CDEFG)) = 14 ways
((ABC)(DEFG)) = 2x5 = 10 ways
((ABCD)(EFG)) = 5x2=10 ways
((ABCDE)(FG)) = 14 ways
((ABCDEF)G) = 42 ways
Total = 42+14+10+10+14+42 = 132 ways
  

edited
2 votes
2 votes
Both are different questions.

1- the number of ways to perform matrix multiplication is 132.

As we have direct formula for this.

(2n!)/(n+1)!*n!

If we have 7 matrix then n should be 6.

2- number of ways to parenthesis means at starting how many ways we can split the matrix.

For 3 matrix we can split 2 ways

For 4 we can split 3 ways.

Thus for 7 matrix we can split or parenthesis 6 ways.
1 votes
1 votes
The question can also be solved by recurrence relation.

T(n) = T(1)T(n-1)+T(2)T(n-2).......T(n-1)T(1)

T(0)=1

T(1)=1

T(2)=1

T(3)=2

T(4)=5

T(5)=14

T(6)=42

T(7)=132

Related questions

2 votes
2 votes
2 answers
3
0 votes
0 votes
1 answer
4
Rohan Mundhey asked Nov 11, 2016
1,630 views
Matrix multiplication is associative and matrix chain multiplication uses following matricesA1 is 30×35A2 is 35×15A3 is 15×5A4 is 5×10A5 is 10×20A6 is 20×25Find the...