4,281 views
1 votes
1 votes

Which of the following is the recurrence relation for the matrix chain multiplication problem where p[i-1]*p[i] gives the dimension of the i^th matrix?

  1.   dp[i,j]=1 if i=j
    dp[i,j]=min{dp[i,k]+dp[k+1,j]}
  2.   dp[i,j]=1 if i=j
    dp[i,j]=min{dp[i,k]+dp[k+1,j]}+p[i-1]*p[k]*p[j]
  3.   dp[i,j]=0 if i=j
    dp[i,j]=min{dp[i,k]+dp[k+1,j]}
  4.   dp[i,j]=0 if i=j
    dp[i,j]=min{dp[i,k]+dp[k+1,j]}+p[i-1]*p[k]*p[j]

3 Answers

Related questions

0 votes
0 votes
1 answer
2
Rohan Mundhey asked Nov 11, 2016
1,578 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...
0 votes
0 votes
1 answer
3
2 votes
2 votes
2 answers
4