= Solution
Use binary units $1\mathrm{KB}=2^{10}$ bytes and $1\mathrm{MB}=2^{20}$ bytes, consistent with the given binary GB convention. Reading one average file takes seek plus rotation plus transfer; moving it requires the same costs again on the write:
$$
\boxed{t_{\rm file}=2\left(0.005+0.004+\frac{8\cdot2^{10}}{8\cdot2^{20}}\right)=0.019953125\text{ s}\approx20\text{ ms}.}
$$
A half-full 16 GB disk contains $8\cdot2^{30}$ used bytes, or $N=2^{20}$ average files. Under the stated per-file <disk compaction> model,
$$
\boxed{T=N t_{\rm file}=20922.368\text{ s}\approx5.81\text{ hours}.}
$$
A calculation with decimal KB and MB changes the unrounded figures, so the unit convention must be retained consistently. This model charges one seek and rotational delay on each read and each write; it does not assume a single streaming pass over the whole disk.
Back to article page