For the Fractional Knapsack Problem, determine the maximum total value of your backpack.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
You have a knapsack that can hold 20 pounds.
You can fill your knapsack with any items from the following list.
Item
Weight
Value
Object A
4 pounds
$480
Object B
5 pounds
$500
Object C
6 pounds
$480
Object D
7 pounds
$490
Object E
8 pounds
$520
Your goal is to pick the objects that maximize the total value of your knapsack, with the condition that the chosen
objects weigh at most 20 pounds.
In the 0-1 Knapsack Problem, the solution is easily seen to be Objects B + D + E, which has a total weight of 5+7+8 =
20 pounds, and a total value of $500+$490+$520 = $1510.
%3D
In the Fractional Knapsack Problem, you are allowed to take f of each object, where f is some real number between 0
and 1. For example, you can take all of Object A, 1/2 of Object C, all of Object D, and 3/4 of Object E.
This leads to a solution with total weight 4 + 1/2 x (6) + 7 + 3/4 × (8) = 20 pounds and a total value of $480 + 1/2 ×
($480) + $490 + 3/4 × ($520) = $1600.
Can you do better?
For the Fractional Knapsack Problem, determine the maximum total value of your backpack.
Transcribed Image Text:You have a knapsack that can hold 20 pounds. You can fill your knapsack with any items from the following list. Item Weight Value Object A 4 pounds $480 Object B 5 pounds $500 Object C 6 pounds $480 Object D 7 pounds $490 Object E 8 pounds $520 Your goal is to pick the objects that maximize the total value of your knapsack, with the condition that the chosen objects weigh at most 20 pounds. In the 0-1 Knapsack Problem, the solution is easily seen to be Objects B + D + E, which has a total weight of 5+7+8 = 20 pounds, and a total value of $500+$490+$520 = $1510. %3D In the Fractional Knapsack Problem, you are allowed to take f of each object, where f is some real number between 0 and 1. For example, you can take all of Object A, 1/2 of Object C, all of Object D, and 3/4 of Object E. This leads to a solution with total weight 4 + 1/2 x (6) + 7 + 3/4 × (8) = 20 pounds and a total value of $480 + 1/2 × ($480) + $490 + 3/4 × ($520) = $1600. Can you do better? For the Fractional Knapsack Problem, determine the maximum total value of your backpack.
Richard has blocked off six weeks from early-May to mid-June to create timetables for high schools in British
Columbia. (His work in school timetabling is part of his consulting e and his research .)
During these six weeks (i.e, 30 work days), schools request Richard for a certain time interval.
For the purposes of this problem, assume there are eight schools (labelled A, B, C, D, E, F, G, H), where each school is
only available to work with Richard during these time intervals.
A. [21,25]
В. [8,14]
C. [20,30]
D. [24,29]
E. [1,9]
F. [2,6]
G. [16,22]
Н. [13,17]
For example, School H is requesting Richard on Days 13, 14, 15, 16, 17. They need to work with Richard on all five
days, and they are unavailable on all of the other days.
Richard refuses to double-book clients. In other words, if he accepts a contract with School E, he will not work with
School F (since the intervals [1,9] and [2,6] overlap), nor with School B (since the intervals [1,9] and [8,14] overlap).
Richard charges the same amount for each timetable, regardless of the length of the school's contract. Thus, School H
(with only five days of work) would pay Richard the exact same amount as School C (with eleven days of work).
Naturally, Richard wants to maximize his total revenue.
To do this, he needs your help to figure out which schools to work with.
Determine the choice of schools that will enable Richard to maximize his total revenue.
Transcribed Image Text:Richard has blocked off six weeks from early-May to mid-June to create timetables for high schools in British Columbia. (His work in school timetabling is part of his consulting e and his research .) During these six weeks (i.e, 30 work days), schools request Richard for a certain time interval. For the purposes of this problem, assume there are eight schools (labelled A, B, C, D, E, F, G, H), where each school is only available to work with Richard during these time intervals. A. [21,25] В. [8,14] C. [20,30] D. [24,29] E. [1,9] F. [2,6] G. [16,22] Н. [13,17] For example, School H is requesting Richard on Days 13, 14, 15, 16, 17. They need to work with Richard on all five days, and they are unavailable on all of the other days. Richard refuses to double-book clients. In other words, if he accepts a contract with School E, he will not work with School F (since the intervals [1,9] and [2,6] overlap), nor with School B (since the intervals [1,9] and [8,14] overlap). Richard charges the same amount for each timetable, regardless of the length of the school's contract. Thus, School H (with only five days of work) would pay Richard the exact same amount as School C (with eleven days of work). Naturally, Richard wants to maximize his total revenue. To do this, he needs your help to figure out which schools to work with. Determine the choice of schools that will enable Richard to maximize his total revenue.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Encryption and decryption
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education