0 Up votes0 Down votes

18 views7 pagesimportant very important
important very important
important very important
important very important

Jun 04, 2014

© © All Rights Reserved

PDF, TXT or read online from Scribd

important very important
important very important
important very important
important very important

© All Rights Reserved

18 views

important very important
important very important
important very important
important very important

© All Rights Reserved

- The Canadian Airline Problem and the Bitonic Tour: Is This Dynamic Programming?
- DSA- Answer Key
- Knapsack
- 10.1.1.63.6662 (1)
- design analysis of algorithm
- Algorithms Question Bank
- algorithm2
- Alice Yalaoui
- lec8
- Handout Preparation Model
- pavement Management System text book
- 08linp78
- Wind Forecasting Using Artificial Neural Networks
- 17-dynprog2
- SCIENTIA MAGNA, book series, Vol. 2, No. 4
- Nonlinear Least
- Assignments DAA
- Probability
- Mining E-Commerce Feedback Comments to Evaluate Multi Dimension Trust
- Unbound Knap sack

You are on page 1of 7

Instructor: Dr. Natarajan Meghanathan

Chapter 8 Dynamic Programming, Question Bank

1) There are a row of 6 coins of values {5, 1, 2, 10, 6, 2}; the objective is to pick up the maximum

amount of money subject to the constraint that no two coins adjacent in the above list can be

picked up. Develop a dynamic programming solution for this optimization problem You need

to write the recurrence relation and provide step-by-step details of the solution.

F(n) = Max{ c

n

+ F(n-2), F(n-1)} for n > 1

F(0) = 0; F(1) = c

1

.

The coins that need to be picked up to obtain the maximum sum of 17 are {C1 = 5, C4 = 10, C6 = 2}

2) There are a row of 8 coins of values {3, 1, 5, 2, 5, 4, 2, 3}; the objective is to pick up the

maximum amount of money subject to the constraint that no two coins adjacent in the above

list can be picked up. Develop a dynamic programming solution for this optimization problem

You need to write the recurrence relation and provide step-by-step details of the solution.

The coins that need to be picked up to obtain the maximum sum of 16 are {C1 = 3, C3 = 5, C5 = 5, and

C3 = 3}

2

3) Compute the binomial coefficient C(10, 7) using dynamic programming. Write the recurrence

relation.

Recurrence: C(n,k) = C(n-1,k) + C(n-1,k-1) for n > k > 0

C(n,0) = 1, C(n,n) = 1 for n 0

4) Write the recurrence relations (including the initial conditions) and the time/space complexity

for the following dynamic programming algorithms/problems discussed in class:

(a) Binomial Coefficients Problem:

C(n,k) = C(n-1,k) + C(n-1,k-1) for n > k > 0

C(n,0) = 1, C(n,n) = 1 for n 0

Both Time and Space Complexity are: (nk).

(b) Coin Row Problem:

Maximal value of coins selected from the list {c1, c2, ...., cn} is

F(n) = Max{ c

n

+ F(n-2), F(n-1)} for n > 1

F(0) = 0; F(1) = c

1

.

Both Time and Space Complexity are: (n).

(c) Coin Selection Problem

Let F(i, j) be the largest number of coins the robot can collect and bring to the cell (i, j) in the ith row and

jth column of the board.

where c

ij

= 1 if there is a coin in cell (i, j) and c

ij

= 0 otherwise

Both Time and Space Complexity are: (nm).

(d) Integer Knapsack Problem

Let F(i, j) be the value of the most valuable subset of the first i items (1 i n) that fit into the knapsack

of capacity j (1 j W).

3

Initial Condition: F(0, j) = 0 for 1 j W F(i, 0) = 0 for 1 i n

Both Time and Space Complexity are: (nW), where n is the number of items in the list and W is the

integer capacity of the knapsack.

5) Several coins are placed in cells of a 6 x 6 board (n x m board) shown below, with no more than

one coin per cell. A robot, located in the upper left cell of the board, needs to collect as many of

the coins as possible and bring them to the bottom right cell. On each step, the robot can move

either one cell to the right or one cell down from its current location. When the robot visits a

cell with a coin, it always picks up that coin.

Design a Dynamic Programming algorithm to find the maximum number of coins the robot can

collect and a path it needs to follow to do this. You need to write the recurrence relation and clearly

define all the terms/variables involved in it. Briefly explain how would you trace back your

computation and determine the optimal path for the robot. Execute the above on the board.

Solution:

4

6) Find the composition of items that maximizes the value of the knapsack of integer capacity-

weight 5. Also, write the recurrence relation.

Solution:

Recurrence relation:

7) Find the composition of items that maximizes the value of the knapsack of integer capacity-

weight 6. Also, write the recurrence relation.

Solution:

Recurrence relation:

5

8) Run the Floyds algorithm on the following digraph and deduce the paths from v2 to v4 and

vice-versa.

6

9) Run the Floyds algorithm on the following digraph (given its adjacency matrix) and deduce the

paths from v1 to v3 and vice-versa.

7

- The Canadian Airline Problem and the Bitonic Tour: Is This Dynamic Programming?Uploaded byDeshi Zheng
- DSA- Answer KeyUploaded bysouvik samanta
- KnapsackUploaded byskimdad
- 10.1.1.63.6662 (1)Uploaded byabhi
- design analysis of algorithmUploaded byParinyas Singh
- Algorithms Question BankUploaded byPablo Ahmed
- algorithm2Uploaded byAhmad Hassan
- Alice YalaouiUploaded bygkgj
- lec8Uploaded byRav Venkatesh
- Handout Preparation ModelUploaded byPrasadDam
- pavement Management System text bookUploaded byGoutham Athem
- 08linp78Uploaded bymuji7
- Wind Forecasting Using Artificial Neural NetworksUploaded byMumawaddah Rizqiyatul Hayyah
- SCIENTIA MAGNA, book series, Vol. 2, No. 4Uploaded byAnonymous 0U9j6BLllB
- Nonlinear LeastUploaded bythamizh555
- 17-dynprog2Uploaded byduyanh92
- Assignments DAAUploaded bySandip Gajera
- ProbabilityUploaded by29_ramesh170
- Mining E-Commerce Feedback Comments to Evaluate Multi Dimension TrustUploaded byIJMER
- Unbound Knap sackUploaded byGodisgreate
- 44 Dynamic ProgrammingUploaded byErika Almeida
- 337375268-Hit-and-Miss-Example-or-Report.pptxUploaded byAbhishek Pandey
- algorithms-10-00122-v2Uploaded byastonlee
- chapter 1Uploaded byJo An Valdez
- Compre-AUploaded byShreyas
- Dynamic Programming-Hand OutUploaded byWahyudi Wahdani
- 07707449Uploaded byrakesh das
- Math 10 Factoring Polynomials.pdfUploaded by-Lady Kate-
- Mahbub-Sir.docxUploaded byতোশিবা কিংশুক
- Applied Mathematics forUploaded byMuqeet Mehroon

- The Tattvas of Kashmir Shaivism and SamkhyaUploaded bySurinder Pal
- The Three MalasUploaded bySurinder Pal
- The 36 Tattvas or Components of NatureUploaded bySurinder Pal
- The Conception of Ultimate RealityUploaded bySurinder Pal
- Dynamic ProgrammingUploaded bySurinder Pal
- Syllabus for T3Uploaded bySurinder Pal
- The Doctrine of Śiva and ŚaktiUploaded bySurinder Pal
- shiksha vedangaUploaded bySurinder Pal
- Dynamic Problems (Fundamentals of Algorithms)Uploaded byVyanshu Arora
- RecurrencesUploaded bySurinder Pal
- The Universe According to Kashmir ShaivismUploaded bySurinder Pal
- Trika Shaivism Upaya and MalaUploaded bySurinder Pal
- Breif Summary of VedasUploaded bySurinder Pal
- Maya newUploaded bySurinder Pal
- Shik ShaUploaded bySurinder Pal
- saktiUploaded bySurinder Pal

- Trade Compliance Data Sheet_PRECISIONUploaded byraju
- CMP Lab ReportUploaded byAnisul Karim
- TFIN50 Sample QuestionsUploaded byPrasad Punupu
- en_300909v080501p 05-03_ChCodingUploaded bynassr_ismail
- Small Perturbation ProofUploaded byyalllik
- As 5804.3-2010 High-Voltage Live Working Stick WorkUploaded bySAI Global - APAC
- Syed Khalid, PropelUploaded byNafis Khan
- Peace Corps RFI Notice - SaS June 10 2013 Digital LibraryUploaded byAccessible Journal Media: Peace Corps Documents
- 0000 Field Guide for Use of GPS and GIS OCHAUploaded byAnonymous IapvQV
- 20 Datacenter MeasurementsUploaded bysas
- case study 3Uploaded byTisha Singhal
- e-hrmUploaded byrachealll
- As ISO 16269.7-2004 Statistical Interpretation of Data Median - Estimation and Confidence IntervalsUploaded bySAI Global - APAC
- Chap7_Random_Processes.pdfUploaded byLau Sarmiento
- 4B - Whats New in CA 2E Web OptionUploaded bySumit Dey
- AGB_WiFi_en.pdfUploaded byUugii Uugii
- ECG AuthenticationUploaded byBhoomi Patel
- ParametricUploaded bylovesharmaarchi
- Pay Scale Reclassification 2011Uploaded byhaalday
- Create Setup and Deployment Project Visual Studio 2008Uploaded byHenri Yeutchou
- Graphing Rational FunctionsUploaded byRaganda Silalahi
- Oracle Database 10g Data Warehouse Backup & Recovery Automatic, Simple, And Reliable.pdfUploaded byacsabo_14521769
- Obia7973cert Matrix 395521Uploaded byNeeraj Saini
- 21147FUploaded byansarirahim1
- Alibaba Group_12-May-2015_US_CF.pdfUploaded byInvest Stock
- dbmslecturenotes-100212060546-phpapp02Uploaded byAbirami Satheesh Kumar
- Introduction to Artificial IntelligenceUploaded bysanjai_rahul
- Sample Internal Audit Report 2Uploaded byJoel Espiritu Custodio
- Dell Fraud RedactedUploaded byBryan Adamson
- Basic SAP NavigationUploaded bysatyajitsadekar123

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.