module documentation

Provides matrix_chain function as an example of dynamic programming.

Function matrix_chain Return solution to the matrix chain problem.
def matrix_chain(d):

Return solution to the matrix chain problem.

d is a list of n+1 numbers describing the dimensions of a chain of n matrices such that kth matrix has dimensions d[k]-by-d[k+1].

Return an n-by-n table such that N[i][j] represents the minimum number of multiplications needed to compute the product of Ai through Aj inclusive.