Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



For a knapsack problem, $P$ and $W$ are profits and weights for a set of $7$ items as given below:

$P={9,5,2,7,6,16,9}$

$W={2,5,6,11,1,9,3}$


What is the maximum value of items you can carry if maximum weight allowed is $25$ with a fractional knapsack?





Solution

Take items in decreasing profit by weight ratio:

Item 5: weight $1$, profit $6$

Item 1: weight $2$, profit $9$

Item 7: weight $3$, profit $9$

Item 6: weight $9$, profit $16$

Item 2: weight $5$, profit $5$

Total weight used:

$1+2+3+9+5=20$

Total profit:

$6+9+9+16+5=45$

Remaining capacity:

$25-20=5$

Next best item is item 4 with profit $7$ and weight $11$.

Fractional profit:

$5\times \frac{7}{11}=\frac{35}{11}=3.18$

Maximum profit:

$45+3.18=48.18\approx 48.1$

Correct option is:

$\boxed{(a)\ 48.1}$



Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...