A student taking a test uses greedy strategies to maximize the test results. The input to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A student taking a test uses greedy strategies to maximize the test results. The input to this problem consists of the test time K in minutes, and the (estimated) times to solve each of the n questions on the test, T[1..n], where time T[i]> 0 is the time in minutes for solving question i, 1 ≤ i ≤n. We assume no partial credits will be given; thus a completed test question gets full credits while incomplete answers get 0 credits. We also assume that T[i] > K so that there is not enough time to solve all test questions. (a) (4 marks) Assume that the goal is to maximize the total amount of time the student uses for the completed test questions. Does a greedy algorithm that chooses the longest question at each step (always) generates optimal solutions? If not, given a counterexample. (b) (11 marks) Assume that the goal is to maximize the total number of completed test questions. Design a greedy algorithm for it and prove that your algorithm is correct (always generates optimal solutions). A student taking a test uses greedy strategies to maximize the test results. The input to this problem consists of the test time K in minutes, and the (estimated) times to solve each of the n questions on the test, T[1..n], where time T[i]> 0 is the time in minutes for solving question i, 1 ≤ i ≤n. We assume no partial credits will be given; thus a completed test question gets full credits while incomplete answers get 0 credits. We also assume that T[i] > K so that there is not enough time to solve all test questions. (a) (4 marks) Assume that the goal is to maximize the total amount of time the student uses for the completed test questions. Does a greedy algorithm that chooses the longest question at each step (always) generates optimal solutions? If not, given a counterexample. (b) (11 marks) Assume that the goal is to maximize the total number of completed test questions. Design a greedy algorithm for it and prove that your algorithm is correct (always generates optimal solutions).
Expert Answer:
Answer rating: 100% (QA)
The required answer is as follows theway PantA step 3 step2 stip... View the full answer
Related Book For
1014 Practice Questions For The New GRE
ISBN: 9780375429682
2nd Edition
Authors: The Princeton Review
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
May-22 1 1 1 6 22 31 31 31 31 31 uChampion (UC) Shop commenced business on 1 May 2022. The following transactions occurred during the first month of operations: Jenny, the owner, invested cash into...
-
The Town of Thomaston has a Solid Waste Landfill Enterprise Fund with the following trial balance as of January 1, 2017, the first day of the fiscal year. During the year, the following transactions...
-
Evaluate the series. E (5i + 2) i=3
-
Find the fundamental frequency for torsional vibration of a shaft of length \(2 \mathrm{~m}\) and diameter \(50 \mathrm{~mm}\) when both the ends are fixed. The density of the material is \(7800...
-
Hudson Corporation's balance sheet at December 31, 2016, is presented below. During January 2017, the following transactions occurred. Hudson uses the perpetual inventory method. Jan. 1 Hudson...
-
In this essay, you will explore the communication process, the various types of communication, barriers to effective communication, and their importance to the criminal justice field. You are your...
-
How does an employer use the recruiting and hiring process to attract workers with disabilities.
-
The daily high temperature in a computer server room at the university can be modeled by a normal distribution with mean \(68.7^{\circ} \mathrm{F}\) and standard deviation \(1.2^{\circ} \mathrm{F}\)....
-
An automatic machine fills distilled water in \(500-\mathrm{ml}\) bottles. Actual volumes are normally distributed about a mean of \(500 \mathrm{ml}\) and their standard deviation is \(20...
-
Use the model of perfect competition to explain the rise in corn prices from \($1\) per bushel in 2004 to \($6\) per bushel in 2011.
-
The quantity of aerated water that a machine puts in a bottle of a carbonated beverage follows a normal distribution with a standard deviation of \(0.25 \mathrm{~g}\). At what "normal" (mean) weight...
-
Workers in silicon factories are prone to a lung disease called silicosis. In a recent survey in a factory, about \(11 \%\) of the workers have been infected by it. Assume the same rate of infection...
-
Comma A/S's financial year ends on December 31, 2018. Comma has three machines, which are to be sold in January 2019. All three machines have been in use in 2018. The following table summarizes...
-
Calculate the number of neutrons of 239Pu.
-
Quantity A Quantity B a + b 180 c Quantity A is greater. Quantity B is greater. The two quantities are equal. The relationship cannot be determined from the...
-
If x equals all prime numbers that satisfy the inequality what is the average value of x ? 10-x VI 5 X
-
Mei is building a garden in the shape of an isosceles triangle with one side of 10. If the perimeter of the garden is 32, which of the following is a possible area of the garden? 32 48 50 60 64
-
A political pollster approaches people on the street and asks them to describe their political affiliation. Twenty-eight people describe themselves as Democrats, 25 as Republicans, 8 people provide a...
-
Listed below are a number of hypothetical research hypotheses. For each hypothesis, identify the independent and dependent variable. a. Male drivers are more likely to exhibit road rage behaviors...
-
Listed below are a number of research questions and hypotheses from actual published articles. For each hypothesis, identify the independent and dependent variable. a. The use of color in a Yellow...
Study smarter with the SolutionInn App