Question 42Asked in UGC NET Computer Science, June 2014 (Paper II & III, Selected Questions)

Consider the fractional knapsack instance n = 4, (p₁, p₂, p₃, p₄) = (10, 10, 12, 18), (w₁, w₂, w₃, w₄) = (2, 4, 6, 9) and M = 15. The maximum profit is…

Consider the fractional knapsack instance n = 4, (p₁, p₂, p₃, p₄) = (10, 10, 12, 18), (w₁, w₂, w₃, w₄) = (2, 4, 6, 9) and M = 15. The maximum profit is given by (Assume p and w denotes profit and weight of objects respectively)
  1. A40
  2. B38
  3. C32
  4. D30
Show answerHide answer

Correct answer: (B) 38

Explanation

P₁/w₁ = 5, p₂/w₂ = 2.5, p₃/w₃ = 2, p₄/w₄ = 2. Select object 1 (profit 10), then object 2 (profit 10). Objects 3 and 4 have the same ratio, but object 4 gives more profit and fits exactly: total weight = 2 + 4 + 9 = 15. Maximum profit = 10 + 10 + 18 = 38. So the answer is (b).

From UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions)

This is question 42 of UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.