List all possible parenthesization of the product ABCDE of 5 matrices.
Solution:
Given,
=>Number of matrices = 5
=>Matrices are A, B, C, D and E
Explanation:
Total number of paranthesization:
=>Total number of paranthesization with n matrices = 1/n*{(2n-2)!/((n-1)!)^2}
=>Total number of paranthesization with 5 matrices = (2*5-2)!/((5-1)!)^2
=>Total number of paranthesization with 5 matrices = (8!/(4!^2))/5
=>Total number of paranthesization with 5 matrices = 40320/(576*5)
=>Total number of paranthesization with 5 matrices = 14
Finding paranthesization:
1: A(B((CD)E))
2: A(B(C(DE)))
3: A((BC)(DE))
4: A((B(CD))E)
5: A(((BC)D)E)
6: (AB)((CD)E)
7: (AB)(C(DE))
8: (A(BC))(DE)
9: ((AB)C)(DE)
10: (A(B(CD))E
11: (A(BC)D))E
12: ((AB)(CD))E
13: ((A(BC))D)E
14: (((AB)C)D)E
I have explained each and every part with the help of statements attached to the answer above.
Get Answers For Free
Most questions answered within 1 hours.