Prove that you should not also use the greedy strategy

Assignment Help Data Structure & Algorithms
Reference no: EM13190743

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 greedy strategy 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 and analyze an algorithm to determine, given the initial sequence of cards, the maximum number of points that you can collect playing against a perfectopponent

Reference no: EM13190743

Questions Cloud

Egocentrism means : TRUE OR FAULSE Egocentrism means that audiences typically approach speeches by asking "Why is this important for me?"
Calculate the economic feasibility in terms of making : As a Plant Manager your plant team informs you that they have found a way to increase the size of the manufacturing run from 10,000 to 18,000 units in increments of 2000 units. The set up cost is 150,000 and defects cost $120 for removal/repair.
Psychoactive drugs produces the quickest : Which of the following psychoactive drugs produces the quickest and most powerful rush of euphoria?
What should be the size of the tax per pact of cigarettes : Studies indicate that the price elasticity of demand for cigarettes is about 0.4. If a pack of cigarettes currently costs $5 and the government wants to put a tax on it to reduce smoking by 20%, what should be the size of the tax per pact of cigare..
Prove that you should not also use the greedy strategy : 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 greedy strategy as Elmo.
Similar ethical guidelines : Many professional organizations have similar ethical guidelines. How do you think they should sanction members who have violated these? Do you think from a practical standpoint they are able to enforce these? How might consumers be involved in helpin..
What fraction of the time will the stock increase in price : what fraction of the time will the stock increase in price?
Lower temperature than does dry version of that same rock : Wet igneous rock (rock that contains volatiles) melts at a lower temperature than does the dry version of that same rock. Volatile-rich magma develops gas bubbles as it rises, and this creates even more buoyant force to move the magma upward more agg..
What happens to price and output in the cournot : FULL karma for complete and clear response. 1. Under what conditions are the Cournot and Bertrand equilibria the same 2. What happens to price and output in the Cournot, Bertrand and Stackelberg models if marginal costs increase by 10 percent

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Write the selection sort algorithm

Write the selection sort algorithm

  Perform the acyclic-topological sort algorithm

Perform the acyclic-topological sort algorithm on the directed graph having vertex set a-k and edges {(j; a);(j; g);(a; b);(a; e);(b; c);(c; k);(d; e);(e; c);(e; f);(e; i);(f; k); (g; d);(g; e);(g; h);(h; e);(h; i);(i; f);(i; k)} Show the state of th..

  Writing a java program

The history teacher at your school requires help grading a True or False test. The students' IDs and test answers are stored in a file document.

  Explain binary tree by induction

Binary tree is full if all of its vertices have either zero or two children. Let Bn denote number of full binary trees with n vertices. Illustrate by induction (substitution) that Bn is 2 (n) .

  Determine expected number of collisions use hash function

Assume we use hash function h to hash n distinct keys into the array T of length m. Suppose simple uniform hashing, determine the expected number of collisions?

  Find out the big-o running time of bubble sort

Find out the big-O running time (tight bound) of bubble sort. Illustrtae your derivation. Count comparisons as critical operation.

  Saving contents of the richtextbox by creating a program

Create the statements to save the contents of the RichTextBox named rtbCurrent. Show a SaveFileDialog named sfdCurrent to get the name of the document from the user.

  Explaining augmented red-black tree

Consider T be augmented red-black tree, where each node x has attribute x.size, which is number of internal nodes in subtree rooted at x. Given such augmented red-black tree T.

  Perform an insertion sort on the file pointed

Using only the local data already supplied in FileSort, perform an insertion sort on the file pointed to by fd. Use lseeks for this; do not try to create any sort of array or list. An array-based version of insertion is supplied for your reference.

  Algorithm for a bank account

Write algorithm to settle following question: A bank account starts out with $10,000. Interest is compounded monthly at 6 percent per year (0.5 percent per month).

  Advanced systems analysis and design

Produce a system specification indicating functional and non-functional requirements - Generate suitable prioritised Use Cases for the system.

  Estimate cost of multi phase multiway merge sort

Find out number of phases needed, and estimate cost of Multi Phase Multiway Merge Sort. Write all BCNF violations. Decompose relations, as essential, into collections of relations whic hare in BCNF.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd