18 views

Uploaded by Surinder Pal

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

- Advanced Encryption Standard
- Clase 27M Signal Analysis Parte 1
- Lecture+32 33+Data+Mining+With+ACO
- Result BP Score
- Placmnt Advice
- 05184822
- 566
- Sequencing Problems 1
- AD-K-O
- Dynamic Programming
- Timetable CAPE May-June 2011 draft 13 August
- Assignment(Difference Equations)
- Suggestion Paper for CS503 - Design and Analysis of Algorithm
- Dynamic Programming examples
- Diff Eq Notes
- Rubiks Cube solution
- 08241758
- Hop Field Net
- Weiner Filter
- Robotic Lab 2

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

- Advanced Encryption StandardUploaded bycourageouscse
- Clase 27M Signal Analysis Parte 1Uploaded byLaura Angulo
- Lecture+32 33+Data+Mining+With+ACOUploaded byfz18
- Result BP ScoreUploaded byRapeeporn Chamchong
- Placmnt AdviceUploaded bySri Badma
- 05184822Uploaded byJami Burnett
- 566Uploaded byThangavel Vel
- Sequencing Problems 1Uploaded byAravind
- AD-K-OUploaded byabeastinme
- Dynamic ProgrammingUploaded byfatma-taher
- Timetable CAPE May-June 2011 draft 13 AugustUploaded byJahnoi Anderson
- Assignment(Difference Equations)Uploaded byQureshi233
- Suggestion Paper for CS503 - Design and Analysis of AlgorithmUploaded byMyWBUT - Home for Engineers
- Dynamic Programming examplesUploaded byCoeus Apollo
- Diff Eq NotesUploaded byMin Jae Park
- Rubiks Cube solutionUploaded byAubuna
- 08241758Uploaded byYousef Ahmed
- Hop Field NetUploaded byZheng Ronnie Li
- Weiner FilterUploaded byKomal Ahmad
- Robotic Lab 2Uploaded bykienho88
- Adaptive Line EnhancerUploaded byYgb Reda
- An Efficient Ant Colony Optimization for Two-dimensional Bin Packing Problem with Defect IssueUploaded bySDIWC
- 08 Medians and Order StatisticsUploaded byZemal Malik
- Clipping 1Uploaded byDương Bá Phục
- Pre Algebra Lesson 7 2Uploaded by412137
- MATA33_Final_2011S.pdfUploaded byexamkiller
- Tsnnppt 150201110139 Conversion Gate01.PptxUploaded bymonumunduri
- Active Noise CancellationUploaded bySuman Paul Choudhury
- A Tabu Search Based Algorithm For Minimizing Teh Number of Tool Switches on a Flexible MachineUploaded byRafael Tobias Toledo Subirana

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

- Literature Review on CFD Application for Helical Coil Heat Exchanger DesignUploaded bySantosh Sancheti
- Algorithms VLSI CAD Final f07Uploaded bychilledkarthik
- Optimization QuestionsUploaded byaditvas
- Lu DecompositionUploaded byFengxing Zhu
- AT-Polynomials.pdfUploaded byCristian Zanoci
- Aa Guide to Graduate Studies 2016-17Uploaded bygabriele
- 14 dual2Uploaded byAngad Sehdev
- 9 Syllabus - Information TechnologyUploaded byAnonymous nTxB1EPv
- Modification of Simplex Method and Its Implementation in Visual Basic SimplexfolUploaded bymtx993
- Model FittingUploaded byJC Asido
- Analysis of an Arbitrarily-Shaped Planar Circuit a Time-Domain ApproachUploaded bySudantha Jayalal Perera
- State-Dependent Riccati EquationUploaded byfx_amv
- Kumpulan Iterasi MATLABUploaded byZia Silver
- ('Christos Papadimitriou', 'Midterm 2', '(solution)') Fall 2009.pdfUploaded byJohn Smith
- 37-06Uploaded bykodandaram
- ANALYTICAL AND EXPERIMENTAL ANALYSIS OF THE LARGE DEFLECTION OF A CANTILEVER BEAM SUBJECTED TO A CONSTANT, CONCENTRATED FORCE, WITH A CONSTANT ANGLE, APPLIED AT THE FREE ENDUploaded byLahcen Akerkouch
- 2014_A Two Step Approach for Damage Identification in PlatesUploaded byPham Huu Loc Ho
- Galois Field Computation in MATLABUploaded byostrilis53
- 2Uploaded byAditya
- Unit 3 Snm Ma6452Uploaded byl8o8r8d8s8i8v8
- 1234543Uploaded byAnonymous e8Sugip
- Elliptic ErrorAnalysisUploaded byNishant Panda
- 1-s2.0-S0267726115002997-main.pdfUploaded byHanamant Hunashikatti
- F04 MSc Mathematics 0Uploaded byAriadne_777
- Circuit Design Using Personal ComputersUploaded byBob Stone
- CTPS_suUploaded byGauravSabhahit
- Chapter 2Uploaded byLyana Jaafar
- nc10Uploaded byHamid Rehman
- 9789382332640.pdfUploaded byjyoti
- BesterN2013-ConcreteLaboratoryReportUploaded byShaluka Wijesiri