retagged by
10,286 views
14 votes
14 votes
Consider the following set of processes, assumed to have arrived at time $0$. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the order$P_1, P_2, P_3, P_4$.

$\begin{array}{|l|l|l|l|l|} \hline \text{Processes} & P_1 & P_2 & P_3 & P_4 \\ \hline \text{Burst time (in ms)} &8  & 7 & 2 & 4 \\ \hline \end{array}$

If the time quantum for RR is $4$ ms, then the absolute value of the difference between the average turnaround times (in ms) of SJF and RR  (round off to $2$ decimal places is_______
retagged by

3 Answers

Best answer
15 votes
15 votes

SJF:

$$\small \begin{array} {|c|c|c|c|} \hline \textbf{Process} & \textbf{Burst Time} & \textbf{Completion Time} & \textbf{Turn Around Time} \\\hline P_{1} & 8 & 21 & 21 \\ P_{2} & 7 & 13 & 13  \\ P_{3} & 2 & 2 & 2 \\ P_{4} & 4 & 6 & 6 \\\hline \end{array}$$Average Turn-Around Time $: \frac{21+13+2+6}{4}= 10.5$

RR:

$$\small \begin{array} {|c|c|c|c|} \hline \textbf{Process} & \textbf{Burst Time} & \textbf{Completion Time} & \textbf{Turn Around Time} \\\hline P_{1} & 8 & 18 & 18 \\ P_{2} & 7 & 21 & 21  \\ P_{3} & 2 & 10 & 10 \\ P_{4} & 4 & 14 & 14 \\\hline \end{array}$$Average Turn-Around Time $: \frac{18+21+10+14}{4}= 15.75$

Absolute Difference $= \mid 10.5 - 15.75 \mid = 5.25.$

edited by
6 votes
6 votes

Answer : 5.25
Since arrival time of all process is same =0, So turn around time = finish time

For SJF :

Process Burst Time Completion Time Turn Around Time
P1 8 21 21
P2 7 13 13
P3 2 2 2
P4 4 6 6


Average Turn Around Time using SJF : $\frac{21+13+2+6}{4}$= 10.5

For RR(4 Time quantum):

Process Burst Time Completion Time Turn Around Time
P1 8 18 18
P2 7 21 21
P3 2 10 10
P4 4 14 14

Average Turn Around Time using RR :$\frac{18+21+10+14}{4}$= 15.75

Absolute Difference = 15.75 - 10.5= 5.25

edited by
1 votes
1 votes

absolute value of the difference between the average turnaround times (in ms) of SJF and RR  is 5.25

Answer:

Related questions

51 votes
51 votes
10 answers
2
28 votes
28 votes
8 answers
3
Arjun asked Feb 12, 2020
16,295 views
The number of permutations of the characters in LILAC so that no character appears in its original position, if the two L’s are indistinguishable, is ______.