subject

Athief is given the choice ofnobjects to steal, but only has one knapsack with a capacity of takingmweight. each objectihas weightwi, and profitpi.(a) first, suppose that the objects are divisible (e. g., the thief is in a cheese shop and the itemsare rolls of cheese that can be cut). for each objecti, if a fractionxi, 0≤xi≤1 (takingxi= 1 would be taking the entire object) is placed in the knapsack, then the profit earnedispixi. come up with an efficient greedy algorithm for maximizing the profit of the thief. prove the correctness and running time.(b) now, suppose the items cannot be taken fractionally. in other words, the thief can eithertake an entire item or leave it behind. suppose we also know the following: the order of theseitems when sorted by increasing weight is the same as their order when sorted by decreasingvalue. give a greedy algorithm to find an optimal solution to this variant of the knapsackproblem. prove the correctness and running time.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
Check my work the microprocessor is a(n) circuit, which is designed to process data based on a set of instructions. most desktop and laptop devices contain a microprocessor based on the standard. most tablets and smartphones contain processors based on technology. a microprocessor's circuitry is designed to perform a limited number of tasks contained in its set. during processing, an instruction is loaded into the processor's unit. data is loaded into registers in the processor's where arithmetic and logic operations are performed. microprocessor performance can be measured by its speed. other factors affecting overall processing performance include word size, cache size, and instruction set complexity. most digital devices contain only one microprocessor chip, but today's multi- processors contain circuitry that supports parallel processing. computers contain various kinds of memory. random memory is a special holding area for data, program instructions, and the system. it stores data on a temporary basis until the processor makes a data request. ram is different from disk storage because it is , which means that it can hold data only when the computer power is turned on. computers also contain read- memory, which is a type of non-volatile memory that provides a set of "hard-wired" instructions, called the loader, that a computer uses to boot up.
Answers: 3
question
Computers and Technology, 22.06.2019 09:40
In the lab, which of the following displayed a list of all installed services and included a description of the service, the current state, and whether the service started automatically or manually? a. the services manager b. the applications summary c. the recommended services d. list the safe services list
Answers: 2
question
Computers and Technology, 22.06.2019 19:00
How is the number 110 written when expanded out to place values in the base 2 (binary) number system? options: 2 x 4 + 3 x 2 + 4 x 1 1 x 2 + 1 x 2 + 0 x 2 1 x 100 + 1 x 10 + 0 x 1 1 x 4 + 1 x 2 + 0 x 1
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
If chris has a car liability insurance, what damage would he be covered for
Answers: 1
You know the right answer?
Athief is given the choice ofnobjects to steal, but only has one knapsack with a capacity of takingm...
Questions
question
Physics, 16.07.2019 19:40
Questions on the website: 13722362