Four Matrices and of dimensions and respectively can be multiplied in several ways with different number of total scalar multiplications. For example when multiplied as , the total number of scalar multiplications is . When multiplied as , the total number of scalar multiplications is .
If and , then the minimum number of scalar multiplications needed is
View worked solution
Answer: C
The dimensions of the four matrices are:
For matrices, there are possible parenthesizations. Let's evaluate the most promising ones to find the minimum cost:
Case 1:
- Cost of [resulting in a matrix]:
- Cost of [resulting in a matrix]:
- Cost of multiplying the result with :
- Total cost =
Case 2:
- Cost of [resulting in a matrix]:
- Cost of multiplying with [resulting in a matrix]:
- Cost of multiplying with :
- Total cost =
Evaluating other parenthesizations yields even larger values (e.g., costs ). Thus, the minimum number of scalar multiplications is .
Free practice · Your answers on this page are not saved.
