Question: Consider a computer game with a 2 D map with axes A ( A _ ( 1 ) , A _ ( 2 ) ,

Consider a computer game with a 2D map with axes A(A_(1),A_(2),dots,A_(n)) and B(B_(1),B_(2),dots,B_(m)). The
goal is to start from A_(1)B_(1) and arrive at A_(n)B_(m) by moving one step at a time. At each coordinate
you arrive, you gain a (positive) number of game points. You have to reach C coins at the end
of the game (your total score should be C, not less or not more). Additionally, there is a rule
that constricts your movement. If you are at A_(i)B_(j), your next move should be either A_(i)B_(j+1) or
A_(i+1)B_(j), no other.
Example of the game map and proper gameplay: Gameplay example (1):
Route: ,A_(1)B_(1)->A_(1)B_(2)->A_(2)B_(2)->A_(2)B_(3)->dots->A_(n)B_(m)
Points: 25+30+15+11+dots+12=C
Gameplay example (2):
Route: ,A_(1)B_(1)->A_(1)B_(2)->A_(2)B_(2)->A_(3)B_(2)->dots->A_(n)B_(m)
Points: 25+30+15+88+dots+12=C
Problem: To find the number of possible routes to reach exactly points at the end of the game
(a) Construct an algorithm (which is not a DP algorithm) to solve the problem and write down the pseudo-code.
(b) Analyze the time complexity of your algorithm.
(c) Without using DP, how does affects the running time of the algorithm?
(d) Design a DP algorithm to solve the problem.
(e) Is it necessary to use DP, if the problem asks for the maximum number of points, instead of exactly points?
when you are asked to design a dynamic programming algorithm, you should answer the following questions.
(i) What are the sequence decision steps?
(ii) What are the alternatives at each decision step?
(iii) Describe the subproblems.
(iv) Write the recurrence relation. Explain why it is correct.
(v) Describe the table that is necessary for the dynamic programming algorithm.
(vi) Describe how to fill the table.
(vii) Write down the pseudo-code of the dynamic programming algorithm to fill the table.
(viii) Analyze the running time efficiency of your algorithm.
(ix) Analyze the space efficiency.
(x) Write down the pseudo-code of an algorithm to find the actual solution for the problem
 Consider a computer game with a 2D map with axes A(A_(1),A_(2),dots,A_(n))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!