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

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

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 ﬁnding 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
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

## This note was uploaded on 01/06/2012 for the course CS 3230 taught by Professor Sanjay during the Fall '10 term at National University of Singapore.

Ask a homework question - tutors are online