Redirected
edited by
1,705 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.
edited by

2 Answers

1 votes
1 votes
$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$

Related questions

0 votes
0 votes
2 answers
2
go_editor asked Mar 28, 2020
409 views
How many states can a process be in ?$2$$3$$4$$5$
0 votes
0 votes
2 answers
3
go_editor asked Mar 28, 2020
1,465 views
A program has five virtual pages, numbered from $0$ to $4$. If the pages are referenced in the order $012301401234$, with three page frames, the total number of page faul...
0 votes
0 votes
2 answers
4
go_editor asked Mar 28, 2020
499 views
Average process size = $s$ bytes. Each page entry requires $e$ bytes. The optimum page size is given by :$\sqrt{(se)}$$\sqrt{(2se)}$$s$$e$