(20%) Dymamic Programming: You are given an exam with questions numbered 1,2,3,...,n. Each question i is...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(20%) Dymamic Programming: You are given an exam with questions numbered 1,2,3,...,n. Each question i is worth p, points. You must answer the questions in order, but you may choose to skip some questions. The reason you might choose to do this is that even though you can solve any individual question i and obtain the p, points, some questions are so frustrating that after solving them you will be unable to solve any of the following f. questions. Suppose that you are given the p, and f, values for all the questions as input. Your goal is to score the maximum amount of points (assume that if you answer a question, your answer is always correct and you score the full p.). (a) (5%) Show the optimal solution for the following set of questions. Indicate the number of points you score and the questions you choose to answer. For any question fill in Y or N in the table below. depending on whether you solve it or not. 1 2 3 4 10 0 Question Pi f Solved? (Y/N) 5 30 20 15 25 1 2 1 0 Total number of points you score: (b) (5%) Devise a recursive (later to become DP) formula to select the optimal score. Notice that it is rather similar to a question in HW4 - for each i, define OPT(i) as the optimal number of points you score for questions 1, 2,...i. When calculating OPT(i) you may either select a question i or not. If so collect the points and optimize on the remaining questions, skipping f. Otherwise, optimize starting from i+1. Notice that the recursion goes from 1 to n, so in the end you return OPT(1). if i>n (boundary) SOPT(i)= max(- -), Otherwise (c) (5%) Write the OPT(i) for the example below. Use the table for your convenience: Question 1 2 3 4 5 Pi 10 30 20 15 25 0 1 2 1 0 OPT(1) (d) (5%) What is the runtime of the DP algorithm as a function of n, the number of questions? Explain briefly. (20%) Dymamic Programming: You are given an exam with questions numbered 1,2,3,...,n. Each question i is worth p, points. You must answer the questions in order, but you may choose to skip some questions. The reason you might choose to do this is that even though you can solve any individual question i and obtain the p, points, some questions are so frustrating that after solving them you will be unable to solve any of the following f. questions. Suppose that you are given the p, and f, values for all the questions as input. Your goal is to score the maximum amount of points (assume that if you answer a question, your answer is always correct and you score the full p.). (a) (5%) Show the optimal solution for the following set of questions. Indicate the number of points you score and the questions you choose to answer. For any question fill in Y or N in the table below. depending on whether you solve it or not. 1 2 3 4 10 0 Question Pi f Solved? (Y/N) 5 30 20 15 25 1 2 1 0 Total number of points you score: (b) (5%) Devise a recursive (later to become DP) formula to select the optimal score. Notice that it is rather similar to a question in HW4 - for each i, define OPT(i) as the optimal number of points you score for questions 1, 2,...i. When calculating OPT(i) you may either select a question i or not. If so collect the points and optimize on the remaining questions, skipping f. Otherwise, optimize starting from i+1. Notice that the recursion goes from 1 to n, so in the end you return OPT(1). if i>n (boundary) SOPT(i)= max(- -), Otherwise (c) (5%) Write the OPT(i) for the example below. Use the table for your convenience: Question 1 2 3 4 5 Pi 10 30 20 15 25 0 1 2 1 0 OPT(1) (d) (5%) What is the runtime of the DP algorithm as a function of n, the number of questions? Explain briefly.
Expert Answer:
Answer rating: 100% (QA)
To Design an O n algorithm for choosing set of questions to answer that maximizes your total points for the given problem To solve this problem we can use a dynamic programming approach Lets define th... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
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...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
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...
-
Identify each of the following items relating to sections of a balance sheet as Current Assets (CA), Property and Equipment (PE), Current Liabilities (CL), Long-Term Liabilities (LTL), or Owners...
-
Pelican Point Financial Groups clientele consists of two types of investors. The first type of investor makes many transactions in a given year and has a net worth of over $1 million. These investors...
-
Explain the various steps in the HRP process.
-
George Oppenheimer, an agent for Wellington Farms of Massachusetts, Inc., had contacted Mark Kiriakou from the Capital Area Food Bank regarding an order for frozen turkey meat. In an exchange of...
-
Billy's Hamburgers, Inc., issued 5%, 10-year bonds payable at 90 on December 31, 2010. At December 31, 2012, Billy reported the bonds payable as follows: Billy uses the straight-line amortization...
-
A clinical resear would like to know if his diet program is effective in lowering patients blood pressure. The following patient. Blood pressure before diet blood pressure after diet 1. 15. 12 2. 15....
-
A backgammon player will be playing three consecutive matches with friends tonight. For each match, he will have the opportunity to place an even bet that he will win; the amount bet can be any...
-
It has almost become a mandatory practice for companies to ensure that employees have fun at work. Many workplaces now have fully-stocked lounges, games rooms, funky painted walls, and regular social...
-
Why is or is not resilience an important aspect of an organization's Information/Cyber Security program? You will need to perform an Internet or research search on resilience.
-
2. Why does Domino's carefully research supply chain potential before it decides to enter a global market?
-
Why is sustainable packaging important? How does the idea of sustainability impact the packaging value chain? How can consumers do their part to help with sustainable packaging? What are three areas...
-
Step One: Look at the 'Diversity Dimensions Wheel' and select at least three dimensions that have most impact you in life and/or work. At least one of the dimensions should be primary. Step Two:...
-
Does a strategic leader need to be a lifelong learner? Why or why not? Can a lifelong leader be a learned trait, or is it something you are born with? Explain your thoughts.
-
Suppose that an investor put her entire wealth into a portfolio that generates an average return of 14% per year with a standard deviation of 21%. The risk-free rate is 3%. What is the investor's...
-
Suppose that the laptop of Prob. 2.16 is placed in an insulating briefcase with a fully charged battery, but it does not go into sleep mode, and the battery discharges as if the laptop were in use....
-
Harold Conners (Social Security number 785-23-9873) lives at 13234 DeMilo Drive, Houston, TX 77052, and is self-employed for 2012. He estimates his required annual estimated tax payment for 2012 to...
-
Your supervisor has asked you to research the following situation concerning Owen and Lisa Cordoncillo. Owen and Lisa are brother and sister. In May 2012, Owen and Lisa exchange business pickup...
-
Ken paid the following amounts for interest during 2012: Qualified interest on home mortgage...........................................$4,700 Auto loan...
-
(a) The longitudinal data set "v4c" is in the vertical format; transform it into the horizontal format. (b) Transform the data set you obtained in part (a) back into the vertical format.
-
Perform some exploratory analysis on the DTS study described above. (a) Compute the mean and standard deviation of the HamD scores for the two treatment groups at each time point. (b) Treat repeated...
-
Plot the mean/SD of HIV knowledge of adolescent girls at baseline and three months post treatment stratified by treatment for the Sexual Health study.
Study smarter with the SolutionInn App