in Operating System edited by
1,635 views
0 votes
0 votes

The aging algorithm with a = $0.5$ is used to predict run times. The previous four runs from oldest to most recent are $40, 20, 20,$ and $15$ msec. The prediction for the next time will be :

  1. $15$ msec.
  2. $25$ msec.
  3. $39$ msec.
  4. $40$ msec.
in Operating System edited by
1.6k views

2 Answers

1 vote
1 vote
$T\rightarrow \ predicated \ time$

$t\rightarrow \ measured \ time$

$a = 0.5 = 1/2$

 

$T_{n+1} = at_{n} +(1-a)T_{n}$

$T_{n+1} = t_{n}/2 +T_{n}/2$

 

$T_{1} = t_{0}/2 +T_{0}/2$

 

$T_{2} =t_{1}/2 +T_{1}/2$

      $= t_{1}/2 +(t_{0}/2 +T_{0}/2)/2 $

      $= t_{1}/2 + t_{0}/4 + T_{0}/4$

 

$T_{3} =t_{2}/2 +T_{2}/2$

      $= t_{2}/2 +(t_{1}/2 + t_{0}/4 + T_{0}/4)/2$

      $= t_{2}/2 +  t_{1}/4 + t_{0}/8 +  T_{0}/8$

 

$T_{4} =t_{3}/2 +T_{3}/2$

      $= t_{3}/2 + (t_{2}/2 +  t_{1}/4 + t_{0}/8 +  T_{0}/8)/2$

      $= t_{3}/2 + t_{2}/4 + t_{1}/8 + t_{0}/16 + T_{0}/16$

 

$T_{0} = t_{0} = 40$

$t_{1} = 20$

$t_{2} = 20$

$t_{3} = 15$

 

$T_{4} = t_{3}/2 + t_{2}/4 + t_{1}/8 + t_{0}/16 + T_{0}/16$

     $= 15/2 + 20/4 + 20/8 + 40/16 + 40/16$

     $=  7.5 + 5 + 2.5 + 2.5 + 2.5$

     $=20 \ msec$

1 comment

edited by
If answer is 20msec , it's not in the given options . Kindly clarify the doubt.  Hope it's 15 msec. If not kindly correct me.
0
0
1 vote
1 vote

20 msec is the answer

Related questions