12 Excise DynamicProgramming 1
12 Excise DynamicProgramming 1
3. (a) What is the longest increasing subsequence problem for a given sequence S of numbers?
(b) Describe a dynamic programing method for the longest increasing subsequence problem.
4. What is the principle of optimality?
5. (a) Describe a dynamic programming algorithm to solve the resource allocation problem.
(b) For the following table, use your algorithm to find an optimal allocation of resources to maximize the total
profit for those three projects and four resources.
resource
1 2 3 4
project
1 3 7 10 12
2 1 2 6 9
3 2 4 8 9
6. (a) Describe a dynamic programming algorithm to find a longest common subsequence of strings S1 and S2.
(b)Use your algorithm to find a longest common subsequence of S1 = TGACATTA and S2 = ATCTGAGTAT.