The SPF strategy can be proven to be optimal in the sense that it minimizes average response times. In this problem, you will demonstrate this result empirically by examining all possible orderings for a given set of five processes. In the next problem, you will actually prove the result. Suppose five different processes are waiting to be processed, and that they require 1, 2, 3, 4, and 5 time units, respectively. Write a program that produces all possible permutations of the five processes (5! = 120) and calculates the average waiting time for each permutation. Sort these into lowest to highest average waiting time order and display each average time side by side with the permutation of the processes. Comment on the results.
What will be an ideal response?
This is a nice problem. It gets the students to write a program quickly. The students are curious to know if their intuition is correct. The result of this brute-force programming approach is not a mathematical proof, but it is a nice lead into the next problem.
Computer Science & Information Technology
You might also like to view...
Which of the following does not destroy the data on a hard drive?
A) Disk wiping B) Data destruction C) Formatting D) Degaussing
Computer Science & Information Technology
When you copy a formula containing a(n) ____________________ reference, Excel does not change the column or row references.
Fill in the blank(s) with the appropriate word(s).
Computer Science & Information Technology