Similar questions 2 more →
Dynamic Programming

Answer & solution
Official answer: C
Step through it (8 steps)
For dimensions 10, 100, 20, 5, 80, the five full parenthesizations have costs 25000 for(((AB)C)D), 19000 for((A(BC))D), 44000 for((AB)(CD)), 130000 for(A((BC)D)) and 248000 for(A(B(CD))). The minimum is 19000, attained by BC costing 100×20×5=10000, then A(BC) costing 10×100×5=5000, then the final product costing 10×5×80=4000. Thus C.
Label the matrices A,B,C,D. Dimensions of intermediate results matter: BC is 100×5, A(BC) is 10×5, and the final product is 10×80. Multiplying the dimensions of each operation yields the stated 10000+5000+4000 optimum. Checking all five full binary parenthesizations proves that this is a global minimum, not merely a good greedy choice. For example, doing AB first already costs 20000 before the remaining work, exceeding the optimum by itself.