Question: points ) There are ' n ' programs that are to be stored on a computer tape of total length ' X ' . Associated

points) There are 'n' programs that are to be stored on a computer tape of total length 'X'. Associated with each
programi is length Li 1<=i <=n. Clearly all the programs can be stored on the tape if and only if the sum of the lengths of
the programs is at most X. We shall assume that whenever a program is to be scanned to on the tape, the tape is initially
positioned at the front. Hence, if programs are stored in the order program1,program2,program3,...programn the time tj
needed to scan to programj is proportional to how far along the tape programj is, which depends on the lengths of the
programs before programj on the tape. For example, if the programs are stored on the tape in the following order
program4, program1, program2, program3 ; then the time t4 needed to scan to the fourth program in the list (program3) is
proportional to L4+L1+L2. If all programs are scanned to equally often (each program has the same chance of being
scanned to, then the expected or mean retrieval time (MRT) is
In the optimal storage on tape problem, we are required to find a permutation (ordering) for the 'n' programs so that when
they are stored on the tape the MRT is minimized.
4a) Give an example of three programs (n=3) with different integer lengths (L1,L2,L3). Show all the permutations
(orderings) possible to store the programs on the tape. Calculate the mean retrieval time for each permutation and find the
optimal ordering. This should give you an indication of a possible greedy choice strategy.
4b) Discuss and prove optimal substructure for the optimal storage on tape problem.
4c) Discuss and prove the greedy choice property for the optimal storage on tape problem.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!