Material:
Textbook (Goodrich/Tamassia), Sections 3.1, 3.2, 4.1, 4.3, 4.8, and Chapter 5.
HOMEWORK 2 PROBLEMS
Consider a system composed of n stages of devices connected in series.
To increase the reliability of the design, each stage i contains
mi devices of type Di connected in parallel.
The internal switching circuitry is responsible for making exactly one device in
each stage active at any time, switching between the devices of a given type in
case of a failure.
Let ri be the reliability of the device Di, i.e. probability that the device will function properly. If stage i contains
mi copies of device Di, its reliability is
determined by a function
F(mi) = 1-(1-ri)mi.
The reliability of the system is determined as a product of the
reliabilities of the individual stages.
Each device Di has a cost ci associated with it.
Determine the number of devices mi in each stage i
to maximize the reliability of the system. This optimization is to be carried out under
a cost constraint: the total cost of the devices must not exceed a given value C.
Implement a computer program for solving a genaral knapsack problem,
capable of handling either fractional or 0-1 knapsack problem.
The input to your system is a file containing a total weight W
of the knapsack, a set of N pairs (weight, benefit) ,
and a parameter specifying whether the program is fractional or 0-1
(this parameter can be entered interactively).
Publish your program on the web, showing the link to the executable
code of the program and provide a short README file explaining how to run it.
Clearly state the limitations, if any, in terms of the number of items
you can handle (at least 20), the size of the sack, etc.
Provide the link to your page on your solution sheet.
A simple data string will be posted later on which you can test your algorithm.
Discuss the data structure used in your program.
Perform experimental analysis to test the efficiency of your program.