Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Coin row revisited: Design a dynamic programming algorithm for the coin row problem but change the constraint to be: You may not pick up

image text in transcribed

1. Coin row revisited: Design a dynamic programming algorithm for the "coin row problem but change the constraint to be: You may not pick up a new coin until you have passed up at least two coins rather than one coin as in the problem discussed in the screencast. Thus, you goal is pick up the maximum amount of money picking up coins leaving at least two coins between each picked up coin. Example: 2 3 4 5 6 7 8 9 10 11 12 121052311111113 -- the answer would be to pick up coins 3(10), 7(11), 12(13) for a total of 34. A. Specify the function that represents the quantity to be optimized. In this case let maxVal (args) represent the maximum value of a feasible solution of picking up the coins in a the coin row. B. Give the recurrence relation that describes the optimal substructure of the problem using maxVal (args). Don't forget to specify the base case(s). C. Give the specification of the table that you would use in a bottom up programmatic solution. Specify the dimensions of the table and what each entry in the table represents. D. Write the pseudo code of the algorithm for filling in the table that you would use in a bottom up programmatic solution. That is convert the recurrence relation (part B.) to an iterative algorithm. E. Write the pseudo code of the algorithm for tracing back through the table to find the set of compatible tasks that gives the maximum total value. F. Write the asymptotic complexity of filling in the table. 1. Coin row revisited: Design a dynamic programming algorithm for the "coin row problem but change the constraint to be: You may not pick up a new coin until you have passed up at least two coins rather than one coin as in the problem discussed in the screencast. Thus, you goal is pick up the maximum amount of money picking up coins leaving at least two coins between each picked up coin. Example: 2 3 4 5 6 7 8 9 10 11 12 121052311111113 -- the answer would be to pick up coins 3(10), 7(11), 12(13) for a total of 34. A. Specify the function that represents the quantity to be optimized. In this case let maxVal (args) represent the maximum value of a feasible solution of picking up the coins in a the coin row. B. Give the recurrence relation that describes the optimal substructure of the problem using maxVal (args). Don't forget to specify the base case(s). C. Give the specification of the table that you would use in a bottom up programmatic solution. Specify the dimensions of the table and what each entry in the table represents. D. Write the pseudo code of the algorithm for filling in the table that you would use in a bottom up programmatic solution. That is convert the recurrence relation (part B.) to an iterative algorithm. E. Write the pseudo code of the algorithm for tracing back through the table to find the set of compatible tasks that gives the maximum total value. F. Write the asymptotic complexity of filling in the table

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

Students also viewed these Databases questions