Question

Algorithms help As a new event in the Wizard-Lympics Tournament, students must compete in pairs in...

Algorithms help As a new event in the Wizard-Lympics Tournament, students must compete in pairs in the following game. An even number n of magical items are laid out in a row, with the i-th item having a value of v(i) in Knuts for each i = 1,2,...,n. The players alternate turns, and on each turn, the player may choose either the first item or the last item remaining in the row, then remove it from the row and add it to their pile. The player with the highest-valued pile at the end wins. (The value of a player’s pile at the end is simply the sum of the value of the items in the pile.) We will use dynamic programming to help us analyze this game.

  1. For a given vector v of values, let F(i,j) denote the maximum value that the first player can definitely achieve using the values v[i],...,v[j]—this means a tight, exact upper bound, an amount which the first player cannot beat, but that the first player can in fact achieve if he/she plays optimally. Write down a recurrence relation for F(i,j) and prove that it is correct. Be sure to include a base case! You can assume that this problem has optimal substructure.
  1. Based on your recurrence from part (a), describe a dynamic programming table and the order in which it should be filled in.
  1. Write pseudo-code for the dynamic programming solution you described in part (b) and analyze its run-time.
0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Algorithms help As a new event in the Wizard-Lympics Tournament, students must compete in pairs in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (2) Suppose, the game is updated so that every item, i, now has weight, wi], in kilograms (you ca...

    Please help with question 2 (c). (2) Suppose, the game is updated so that every item, i, now has weight, wi], in kilograms (you can assume you are passed the item weights in an array, w, of size m). You can only carry n kilograms of weight. (a) (1 point) Example: Let n Ξ 15, m 5. If the item values are v (5.30, 17, 32, 40) and the item weights are w - 2,4, 3,6,15} which should you choose...

  • I posted the question for this and I want to make sure that this answers the...

    I posted the question for this and I want to make sure that this answers the question 1.a) The pseudo code for the closest pair problem is as illustrated below: Closest pair (K, i, j) input: Array K is indexed from i to j. closest pair returns the indices of the closest pairs. diff = K[2] - K[1]   // This is the initial difference between the first two numbers. This is shown through the array and these differences. example: K[2]...

  • C PROGRAMMING LANGUAGE Door of the Ancient Pandy is at the last stage of "Door of...

    C PROGRAMMING LANGUAGE Door of the Ancient Pandy is at the last stage of "Door of the Ancients", his favorite video game. His objective is to pass through a sacred door. There are two ways to do this: By defeating a mighty guardian and snatch the key to the sacred door, or by destroying the sacred door (with brute force) directly. Pandy has no confidence in fighting the mighty guardian, thus Pandy opts to use the second method. Pandy has...

  • CMPS 12B Introduction to Data Structures Programming Assignment 2 In this project, you will write...

    can i get some help with this program CMPS 12B Introduction to Data Structures Programming Assignment 2 In this project, you will write a Java program that uses recursion to find all solutions to the n-Queens problem, for 1 Sns 15. (Students who took CMPS 12A from me worked on an iterative, non-recursive approach to this same problem. You can see it at https://classes.soe.ucsc.edu/cmps012a/Spring l8/pa5.pdf.) Begin by reading the Wikipcdia article on the Eight Queens puzzle at: http://en.wikipedia.org/wiki/Eight queens_puzzle In...

  • hello there, i have to implement this on java processing. can someone please help me regarding...

    hello there, i have to implement this on java processing. can someone please help me regarding that? thanks War is the name of a popular children’s card game. There are many variants. After playing War with a friend for over an hour, they argue that this game must never end . However! You are convinced that it will end. As a budding computer scientist, you decide to build a simulator to find out for sure! You will implement the logic...

  • Game Description: Most of you have played a very interesting game “Snake” on your old Nokia...

    Game Description: Most of you have played a very interesting game “Snake” on your old Nokia phones (Black & White). Now it is your time to create it with more interesting colors and features. When the game is started a snake is controlled by up, down, left and right keys to eat food which appears on random locations. By eating food snake’s length increases one unit and player’s score increases by 5 points. Food disappears after 15 seconds and appears...

  • need help with 18-22 marketing questions med with francesca Je on the COUCO col grocery This...

    need help with 18-22 marketing questions med with francesca Je on the COUCO col grocery This Me span and no CHAPTER 35 Maring Crowng Customer and Engagement Company Caso Chick-Fil-A: Getting Better before Getting Bigger dong the food . Wh e n It Right way, Burger King and Taco Berge mong top of the C hos en bom a south Asocer lo Check Asminis to have a povinu once on who come in contact with Chick corted Chick SA Athough...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT