Skip to content
Worked Examples · Example 31
Q.

The processes P1, P2, P3, P4 given in the table below, arrives for execution in the same order, with Arrival Time 0, and given Burst Time. Find the average waiting time using the FCFS scheduling algorithm.

ProcessBurst Time
P125
P24
P37
P43
CBSENCERTSubjective· 3mImportance★★★★★est
29% · 31/106 Questions
✓ Free question

With FCFS order P1→P2→P3→P4 (all arriving at 00), the waiting times are 0,25,29,360, 25, 29, 36; their average is 904=22.5\dfrac{90}{4}=22.5.

In FCFS (First-Come-First-Served), each process waits for all earlier processes to finish. With all arrival times 00:

Waiting time of a process=sum of burst times of all processes before it,\text{Waiting time of a process}=\text{sum of burst times of all processes before it},

Average waiting time=∑Waiting timesnumber of processes.\text{Average waiting time}=\frac{\sum \text{Waiting times}}{\text{number of processes}}.

  1. Execution order (FCFS): P1, P2, P3, P4. Draw the Gantt chart:

P1⏟0−25 P2⏟25−29 P3⏟29−36 P4⏟36−39\underbrace{\text{P1}}_{0-25}\ \underbrace{\text{P2}}_{25-29}\ \underbrace{\text{P3}}_{29-36}\ \underbrace{\text{P4}}_{36-39}

  1. Waiting time == (start time) −- (arrival time =0=0):
ProcessBurstStartWaiting time
P125000
P24252525
P37292929
P43363636
  1. Sum of waiting times =0+25+29+36=90=0+25+29+36=90.
  2. Average waiting time =904=22.5=\dfrac{90}{4}=22.5 time units.
✓Final answer

Average waiting time (FCFS) =22.5=\mathbf{22.5} time units.

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.