edited by
91 views
2 votes
2 votes
Consider the set of processes whose arrival time and burst time are given below-
$$\begin{array}{|c|c|c|} \hline \textbf{Process Name} & \textbf{Arrival Time} & \textbf{Execution Time}
\\\hline P_{1} & 5 & 5
\\\hline P_{2} & 4 & 6
\\\hline P_{3} & 3 & 7
\\\hline P_{4} & 1 & 9
\\\hline P_{5} & 2 & 2
\\\hline P_{6} & 6 & 3
\\\hline \end{array}$$
If the CPU scheduling policy is Round Robin with time quantum $= 3$ unit. The absolute value of the difference between average waiting time and average turn around time is (rounded to $2$ decimal places) ___________
edited by

2 Answers

4 votes
4 votes
Turn around time is Waiting Time + Execution Time.

So, absolute value of the difference between average waiting time and average turn around time is just the average of the execution times of the processes.

$\qquad = \dfrac{5+6+7+9+2+3}{6} = 5.33$
2 votes
2 votes

 Round Robin with time quantum $= 3$ unit:

$$\begin{array}{|c|c|c|} \hline \textbf{Process Name} & \textbf{AT} & \textbf{ET} & \textbf{CT} & \textbf{TAT} & \textbf{WT}
\\\hline P_{1} & 5 & 5 & 32 & 27 & 22
\\\hline P_{2} & 4 & 6 & 24 & 20 & 14
\\\hline P_{3} & 3 & 7 & 33 & 30 & 23
\\\hline P_{4} & 1 & 9 & 30 & 29 & 20
\\\hline P_{5} & 2 & 2 & 12 & 10 & 8
\\\hline P_{6} & 6 & 3 &21 & 15 & 12
\\\hline \end{array}$$

  • $\text{Turn around time  =  Completion time – Arrival time}$
  • $\text{Waiting time  =  Turn around time – Execution time}$


Queue$:P_{4}P_{2}P_{3}P_{5}P_{4}P_{1}P_{6}P_{2}P_{3}P_{4}P_{1}P_{3}$

Grantt chart:

Average turn around time $ = \dfrac{27+20+30+29+10+15}{6} = \dfrac{131}{6} = 21.83$

Average waiting time $ = \dfrac{22+14+23+20+8+12}{6} = \dfrac{99}{6} = 16.50$

 The absolute value of the difference between average waiting time and average turn around time is $ = \mid 16.50-21.83 \mid  = \mid -5.33 \mid  = 5.33.$

So, the correct answer is $5.33.$

edited by
Answer:

Related questions

1 votes
1 votes
1 answer
1