CS FundamentalsEasyGATE CS (PYQ pattern)

SJF predicts each process's next CPU burst by exponential averaging, tau(n+1) = a x t(n) + (1 - a) x tau(n), with a = 0.5 and tau(0) = 10 ms for every process. The measured bursts so far (oldest first) are P1: 14, 15, 7; P2: 6, 7, 13; P3: 12, 7, 8 ms. All three are now ready. Which process does SJF pick, and with what predicted burst?

  1. A. P1, predicted 7 ms
  2. B. P3, predicted 8.5 ms
  3. C. P2, predicted 8.67 ms
  4. D. P2, predicted 10.25 ms

Correct answer: B. P3, predicted 8.5 ms

P1: 10 -> 12 -> 13.5 -> 10.25. P2: 10 -> 8 -> 7.5 -> 10.25. P3: 10 -> 11 -> 9 -> 8.5. P3 has the smallest prediction. Picking by the latest burst alone gives P1 (7 ms), by the plain mean gives P2 (8.67 ms); the average forgets old bursts geometrically, so P2's recent 13 ms burst outweighs its earlier short ones.

More Operating Systems questions

Exams that ask this topic