18 views

Uploaded by Surinder Pal

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

- Timetable CAPE May-June 2011 draft 13 August
- Assignment(Difference Equations)
- Suggestion Paper for CS503 - Design and Analysis of Algorithm
- Dynamic Programming examples
- 566
- Sequencing Problems 1
- Dynamic Programming
- AD-K-O
- 05184822
- Advanced Encryption Standard
- Clase 27M Signal Analysis Parte 1
- Lecture+32 33+Data+Mining+With+ACO
- Result BP Score
- Placmnt Advice
- MATA33_Final_2011S.pdf
- Tsnnppt 150201110139 Conversion Gate01.Pptx
- Active Noise Cancellation
- A Tabu Search Based Algorithm For Minimizing Teh Number of Tool Switches on a Flexible Machine
- Clipping 1
- Pre Algebra Lesson 7 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

- 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
- 566Uploaded byThangavel Vel
- Sequencing Problems 1Uploaded byAravind
- Dynamic ProgrammingUploaded byfatma-taher
- AD-K-OUploaded byabeastinme
- 05184822Uploaded byJami Burnett
- 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
- 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
- Clipping 1Uploaded byDương Bá Phục
- Pre Algebra Lesson 7 2Uploaded by412137
- 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
- Diff Eq NotesUploaded byMin Jae Park
- Rubiks Cube solutionUploaded byAubuna
- 08241758Uploaded byYousef Ahmed
- Hop Field NetUploaded byZheng Ronnie Li

- shiksha vedangaUploaded bySurinder Pal
- Than DaiUploaded bySurinder Pal
- Trika Shaivism Upaya and MalaUploaded 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
- The Universe According to Kashmir ShaivismUploaded bySurinder Pal
- The Universe According to Kashmir ShaivismUploaded bySurinder Pal
- The Conception of Ultimate RealityUploaded bySurinder Pal
- The 36 Tattvas or Components of NatureUploaded bySurinder Pal
- The Three MalasUploaded bySurinder Pal
- The Three MalasUploaded bySurinder Pal
- Breif Summary of VedasUploaded bySurinder Pal
- RecurrencesUploaded bySurinder Pal
- Than DaiUploaded bySurinder Pal
- Than DaiUploaded bySurinder Pal
- Shik ShaUploaded bySurinder Pal
- AnandUploaded bySurinder Pal
- saktiUploaded 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

- GAUSOVE METODE OVO ONOUploaded bylaki pejic
- Notes on optimization-2Uploaded bySeshu Bollineni
- b9727e74d8f487997705c85c50a8e9876583Uploaded bySandeep Boyina
- Mws Gen Sle Ppt GaussianUploaded bynomiaa
- Linear Programming - Assignment Problem (1)Uploaded bysmexiilori
- Simplex MethodUploaded bySayed Alhussaini
- numerical method lecture note quick.pdfUploaded bysharunnizam
- SSR_CH5optimisationUploaded byManu Bhat
- Gaussian quadratureUploaded bykhordad1366
- PA1.pdfUploaded byshravan
- Fox, Goose, Grain Artificial Intelligence ProblemUploaded bybalwinder
- Taller Raices.xlsxUploaded byNathalia Vallejo
- CSC307-Lab-02_0Uploaded byTemitayo Adewale
- NumericalUploaded byመልሠው ብዙአየሁ መኮንን
- Nonlinear Finite Elements_Weighted Residual Methods - WikiversityUploaded byhasn78
- AOT - Lecture Notes V1Uploaded byS Deva Prasad
- emath12Uploaded byHanilen Catama
- Mws Gen Inp Txt SplineUploaded byApuu Na Juak Eh
- Meshfree MethodsUploaded byYokesh Samannan
- tmp_6817-paper1473520488Uploaded byKarim
- Bisection MethodUploaded byxand
- Trapezoidal RuleUploaded byJairus Samuel
- Strassen's AlgorithmUploaded bygprasadatvu
- FuzzificationUploaded byAvnesh Suryavanshi
- Johan Indrianto Aruan 1506728913 METNUMUploaded byJohan Aruan
- 1_10.pdfUploaded byIan Toby
- Design & OptUploaded byManoj Mallick
- 2012 Gauss Seidel JacobiUploaded byKukuh Kurniadi
- matlab optimizationUploaded byela arasu
- Knot CalUploaded byniksloter84