t8 - M 1 × M 2 × ... × M n , it should be grouped as ( M...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS3230 Tutorial 8 1. Give an argument to show why dynamic programming algorithm gives optimal solution for coin changing problem. 2. Build a table to show how the dynamic programming algorithm will work for finding the optimal algorithm for following matrix multiplication. M 1 × M 2 × M 3 × M 4 × M 5 , where M 1 is a matrix of size 6 × 6 M 2 is a matrix of size 6 × 3 M 3 is a matrix of size 3 × 4 M 4 is a matrix of size 4 × 4 M 5 is a matrix of size 4 × 8 3. Give a counterexample to show that the following conjecture is false: To minimize the number of scalar multiplications of the product
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: M 1 × M 2 × ... × M n , it should be grouped as ( M 1 × M 2 × ...M k ) × ( M k +1 × ... × M n ), where M k has minimum number of columns. 4. Modify the algorithm given in the class to show how the order of matrix multiplication can be obtained along with the optimal number of multiplications needed. 5. Give a dynamic programming algorithm to compute a n given the following formula: a = 1 a n = a n/ 2 * a n/ 2 if n is even. a n +1 = a n/ 2 * a n/ 2 * a if n is odd. 1...
View Full Document

Ask a homework question - tutors are online