Problem-02:
Consider the set of 5 processes whose arrival time and burst time are given below-
Process Id Arrival time Burst time
P1 3 4
P2 5 3
P3 0 2
P4 5 1
P5 4 3
If the CPU scheduling policy is FCFS, calculate the average waiting time and average turn around
time.
Solution-
Gantt Chart-
Here, black box represents the idle time of CPU.
Now, we know-
• Turn Around time = Completion time – Arrival time
• Waiting time = Turn Around time – Burst time
Process Id Exit time Turn Around time Waiting time
P1 7 7–3=4 4–4=0
P2 13 13 – 5 = 8 8–3=5
P3 2 2–0=2 2–2=0
P4 14 14 – 5 = 9 9–1=8
P5 10 10 – 4 = 6 6–3=3
Now,
• Average Turn Around time = (4 + 8 + 2 + 9 + 6) / 5 = 29 / 5 = 5.8 unit
• Average waiting time = (0 + 5 + 0 + 8 + 3) / 5 = 16 / 5 = 3.2 unit