Question: Exercise 4 . How to PASS THE MIDTERM. [ 1 8 points ] Consider an exam with ( n ) questions, each worth

Exercise 4. How to PASS THE MIDTERM.
[18 points]
Consider an exam with \( n \) questions, each worth \( v[i]\) points and requiring \( t[i]\) minutes to solve.
Your goal is to pass the exam with the minimum possible effort. Write an algorithm that, given arrays \( v[1,\ldots, n], t[1,\ldots, n]\), and a threshold \( V \) representing the passing score, finds the subset of questions requiring the least time to achieve the passing score.
(a)(4 points) Let \( T(i, v)\) be the minimum time required to score at least \( v \) points by solving any subset of the first \( i \) problems. Write a recursive expression for \( T(i, v)\).
(b)(8 points) Write the algorithm based on dynamic programming.
(c)(2 points) Analyze the complexity of the proposed algorithm. Justify briefly.
(d)(4 points) Now, suppose that solving a problem partially can yield a proportionate score (e.g., solving \( x \%\) of a problem gives you \( x \%\) of the points). Describe an \( O(n \log n)\) algorithm to solve the same problem.
Exercise 4 . How to PASS THE MIDTERM. [ 1 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!