CS FundamentalsHardGATE CS

SJF predicts the next CPU burst by exponential averaging: τ(n+1) = α·t(n) + (1 − α)·τ(n), with α = 0.75 and initial guess τ(1) = 10 ms. The measured bursts are 8, 4, 6, 2 ms (in that order). What is the predicted length of the 5th burst (to 3 decimal places)?

  1. A. 5.000 ms
  2. B. 2.945 ms
  3. C. 6.195 ms
  4. D. 5.781 ms

Correct answer: B. 2.945 ms

τ2 = 0.75·8 + 0.25·10 = 8.5; τ3 = 0.75·4 + 0.25·8.5 = 5.125; τ4 = 0.75·6 + 0.25·5.125 = 5.78125; τ5 = 0.75·2 + 0.25·5.78125 = 2.945 ms. Swapping the weights gives 6.195, and the plain mean is 5.

More Operating Systems questions

Exams that ask this topic