The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
1 Tokens
You’re playtesting a new boardgame from one of your friends in the Game Design major, and they want your help to figure out the optimal strategy. The game has n rounds and in each round 1  i  n you must acquire si tokens. There are two possible ways to acquire tokens in round i:
Example. Suppose r = 1, C = 40, and the sequence of si is 11, 9, 9, 12, 12, 12, 12, 9, 9, 11. Then the cheapest way to acquire all the tokens is to choose action A for the first three rounds, then action B once, and then action A for the final three rounds.
Give a dynamic programming algorithm for finding the cheapest way to acquire all tokens, given the sequence s1 , s2 , . . . , sn . You must describe not only how you determine the value of the optimal sequence of actions, but also the sequence of actions itself.
-----------