subject

Consider the following game. A "dealer" produces a sequence s1 sn of "cards," face up, where each card si has a value vi. Then two players take turns picking a card from the sequence, but can only pick the first or the last card of the (remaining) sequence. The goal is to collect cards of largest total value. (For example, you can think of the cards as bills of different denominations.) Assume n is even. (a) Show a sequence of cards such that it is not optimal for the first player to start by picking up the available card of larger value. That is, the natural greedy strategy is suboptimal.
(b) Give an O (n2) algorithm to compute an optimal strategy for the first player. Given the initial sequence, your algorithm should precompute in O (n2) time some information, and then the first player should be able to make each move optimally in O (1) time by looking up the precomputed information.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 11:00
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
question
Computers and Technology, 24.06.2019 19:00
Which of the following "invisible" marks represents an inserted tab?
Answers: 1
question
Computers and Technology, 25.06.2019 01:00
Why is outfitting a workplace with video games in a technology development company consiered a strategic use of money
Answers: 1
You know the right answer?
Consider the following game. A "dealer" produces a sequence s1 sn of "cards," face up, where each ca...
Questions
question
Mathematics, 14.05.2021 01:50
question
Mathematics, 14.05.2021 01:50
question
Biology, 14.05.2021 01:50
question
Mathematics, 14.05.2021 01:50
question
Mathematics, 14.05.2021 02:00
question
Mathematics, 14.05.2021 02:00
Questions on the website: 13722361