subject

You and your eight-year-old nephew Elmo decide to play a simple card game. Atthe beginning of the game, the cards are dealt face up in a long row. Each card isworth a different number of points. After all the cards are dealt, you and Elmo taketurns removing either the leftmost or rightmost card from the row, until all the cardsare gone. At each turn, you can decide which of the two cards to take. The winner ofthe game is the player that has collected the most points when the game ends. Having never taken an algorithms class, Elmo follows the obvious greedystrategy—when it’s his turn, Elmo always takes the card with the higher point value. Your task is to find a strategy that will beat Elmo whenever possible. (It might seemmean to beat up on a little kid like this, but Elmo absolutely hates it when grown-upslet him win.)(a) Prove that you should not also use the greedy strategy. That is, show that thereis a game that you can win, but only if you do not follow the same greedystrategy as Elmo.(b) Describe and analyze an algorithm to determine, given the initial sequence ofcards, the maximum number of points that you can collect playing against Elmo.(c) Five years later, Elmo has become a much stronger player. Describe andanalyze an algorithm to determine, given the initial sequence of cards, themaximum number of points that you can collect playing against a perfectopponent

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:30
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
What multimedia system creates an immersive, real-life experience that the user can interact with?
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
Some peer-to-peer networks have a server and some don't. true false
Answers: 2
question
Computers and Technology, 25.06.2019 09:30
An output peripheral interacts with or sends data to the computer provides information to the user from the computer receives data from the computer and sends it to a modem stores data processed by the computer
Answers: 1
You know the right answer?
You and your eight-year-old nephew Elmo decide to play a simple card game. Atthe beginning of the ga...
Questions
question
History, 12.10.2020 01:01
question
Mathematics, 12.10.2020 01:01
question
Mathematics, 12.10.2020 01:01
Questions on the website: 13722361