Answered step by step
Verified Expert Solution
Question
1 Approved Answer
At Tummiache State University, the cafeteria at the student center has a very limited selection of food none of which is very healthy. The pre-med
At Tummiache State University, the cafeteria at the student center has a very limited selection of food none of which is very healthy. The pre-med majors did some research and produced a table showing the number of days that a student's life expectancy would be reduced based upon the selection of food and the number of servings eaten during the student's lifetime Example: The following table is an example where the student must eat n = 10 lunches and the cafeteria offers k-4 food tems Number of Servings Food Items Bad Bland Burritos Greasy Gooey Pizzas Hockey Puck Burgers Chewy Chicken Filets 0 1234 5 6789 10 0 || 3 || 6 || 12 18 24 30 36 48 50 62 0|| 5 || 10130|| 50 60 70 80 90 1001100 0 151515 15 15 16 16 1616 16 For example, if a student eats 2 servings of Bad Bland Burritos, 5 of Greasy Gooey Pizzas, 1 of Hockey Puck Burgers and 2 of Chewy Chicken Filets, then his life expectancy will be reduced by 4 + 24 +5 + 15 - 48 days Notes: o Dieting and bringing your own lunch are not options. The student must eat all n lunches from the given selection o The effect on the student's life expectancy is cumulative. For example, if he eats 6 servings of Bad Bland Burritos then he shaves 12 days off his life due to the Burritos - even if he alternates between Greasy Gooey Pizzas and Burritos o You should assume that the numbers in each row of the table never goes down. I.e., you never increase your life expectancy by eating more of an item Describe a dynamic programming algorithm that minimizes the total reduction in the student's life expectancy after eating n lunches from the k choices. Report your running time in terms of both n and k
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started