DT Q47

0. Four matrices M1, M2, M3 and M4 of dimensions p x q, q x r, r x s and s x t respectively can be multiplied in several ways with different number of total scalar multiplications. For example when multiplied as ((M1 × M2 ) × (M3 × M4 )), the total number of scalar multiplications is pqr + rst + prt. When multiplied as ((M1 × M2 ) × M3 ) × M4 ), the total number of scalar multiplications is pqr + prs + pst.
If p = 10, q = 100, r = 20, s = 5 and t = 80, then the minimum number of scalar multiplications needed is

  • Option : C
  • Explanation :
    The problem can be solved using matrix chain multiplication. we get minimum number of multiplication using ((M1 × M2 ) × M3 ) × M4 )
    = 100 × 20 × 5 + 10 × 100 × 5 + 10 × 5 × 80
    = 19000.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *