Given a chain of matrices
where has dimensions for multiplication
Depends on size of matrix
Parenthesize if important

Suppose that an optimal parenthesiation of splits the product beween and
Let is the minimum number of multiplications needed to compute
- - diagonal terms are zero

fill out direction
for calculate minimum, we need for loop so So we don’t use DP solution

In reality we use Heuristic and approximate algorithm