in Algorithms
4,147 views
1 vote
1 vote

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]
in Algorithms
4.1k views

1 comment

4th option is the correct one.
0
0

3 Answers

1 vote
1 vote

....

0 votes
0 votes

Option 4 is the correct one. For detail explanation http://pegasus.uprm.edu/xryong/COMP6785/L12/L12.pdf

0 votes
0 votes

Check below image................................ 

Related questions

0 votes
0 votes
1 answer
3