Answer:
20.25ms
Explanation:
Given
Process - Burst Time - Arrival Time
P1 - 24 - 0
P2 - 3 - 10
P3- 3 - 3
P4 - 10 - 5
Using the burst time, we'll first create the Gantt chart for the above process.
The Gantt chart is as follows
P1......P2.....P3.........P4
0.....24.....27.....30.....33
Hence, waiting time for P1 will be 0
P1 requires 24 ms for completion, hence waiting time for P2 will be 24 ms
Similarly, waiting time for process P3 will be execution time of P1 + execution time for P2, which will be (24 + 3) ms = 27 ms.
For process P4 it will be the sum of execution times of P1, P2 and P3, which is 30.
The average weight time is then calculated as follows:
(0 + 24 + 27 + 30)/4
= 81/4
= 20.25 ms