CS245  Summer 2000
Assignment 1 

due at the START of class on Monday July 10th
State all assumptions.
Problem 1.  (40 points)
Consider a 5.25 inch disk with 16 double-surfaced platters rotating at
5280 rpm.  It has a usable capacity of 16 gigabytes (2**34 bytes) stored on
1024 cylinders. Assume 12% of each track is used as overhead.
a. What is the burst bandwidth this disk could support reading a
single block from one track?

b. What is the sustained bandwidth this disk could support reading an
entire track?

c. What is the average rotational latency, assuming it is not
necessary to start at the beginning of the track?

d. Assuming the average seek time is 10 ms, what is the average time
to fetch a 4-Kbyte (2**12 bytes) sector?

Problem 2. (15 points)
Consider the "new" Megatron 747 disk, whose properties are defined
in Examples 2.1 and 2.3 in the textbook.
Suppose that we know that the last I/O request accessed cylinder 2000.

a.  What is the expected (average) number of cylinders that will be
traveled due the very next I/O request to this disk?

b.  What is the expected block access time, again given that the
head is on cylinder 2000 initially?

Problem 3. (15 points)
Suppose that we are scheduling I/O requests for the new Megatron 747 disk
(Examples 2.1, 2.2). Recall that the average seek, latency and transfer
times are 6.5, 7.8, and 0.5 milliseconds.
Initially the head is at cylinder 4000, and then the following requests come in:
   time =  0; request for block on cylinder 4000 arrives
   time =  2; request for block on cylinder 6000 arrives
   time =  12; request for block on cylinder 1000 arrives
   time = 17; request for block on cylinder  7000 arrives
   time = 26; request for block on cylinder  3000 arrives

a. If we use the elevator scheduling algorithm, at what time
is each request serviced completely?

b. If we use a first-come-first-served scheduler,
at what time is each request serviced fully?

Problem 4.  (10 points)
Discuss the pros and cons of using fix-format fix-length records. 
Give at least 2 points for each and justify the points you give.
Some issues to consider might be comlexity of implementation, space 
usage and efficiency, flexibility, etc.

Problem 5.  (20 points)
You are designing a file system for a medical application.  Each
patient record has 10 fields that always occur (e.g., name, patient
number) and 40 fields that may or may not be relevant or known for a
patient (e.g., number of children given birth to, cholesterol level).
Assume that each of the optional fields is relevant or known for a
particular patient with probability p.  The values for all fields are
a fixed size of 10 bytes.

You are considering two options:
  (i)  A fixed format record.
  (ii) A variable format record where all fields are tagged.
       Each tag is N byte.

a. What is the expected size of a record for each option?
   Your answer may be a function of p and N.

b. Given that  N=2 byte, for what range of p values is the fixed-format
   format option best?

   Given that  p=0.75, for what range of N values is the variable-format
   option best?