Final answer:
To find the optimum parenthesization of a matrix-chain multiplication, we can use dynamic programming to fill in a table with intermediate results. The table shows the minimum number of scalar multiplications needed to compute the product of matrices from i to j. By tracing back the steps in the table, we can determine the order in which the matrices should be multiplied.
Step-by-step explanation:
The matrix-chain multiplication problem involves finding the most efficient way to multiply a sequence of matrices. To find the optimum parenthesization, we can use dynamic programming.
Let's consider the dimensions of the matrices: {5, 10, 3, 12, 5, 50, 6}. We can form a table to store the intermediate results. The table will have a size of 7x7, where the (i,j)th entry represents the minimum number of scalar multiplications needed to compute the product of matrices from i to j.
To fill in the table, we start with the diagonal entries (i.e., i=j) which have no cost since a single matrix doesn't need to be multiplied. Then, we fill in the table diagonally, considering different split positions for each subproblem.
In the end, the table will look like this:
1 12 4 7 11 4 3
0 10 4 14 11 13 2 4 6
0 12 6 9 10
0 5 13 4
0 10 14 12 11
0 6 10 11 0 11 13 2
0 0 0 0 0 0 0 0 0
To find the optimum parenthesization, we can trace back the steps in the table. Starting with the top-right entry, we can go left or down based on the minimum cost. By repeating this process, we can determine the order in which the matrices should be multiplied.