Question:hard

Consider a CPU that has to execute two types of processes. The first type, Actuators (A), requires a CPU burst of 6 seconds. The second type, Controllers (C), requires a CPU burst of 8 seconds. A new process of type A arrives at time \(t = 10, 20, 30, 40,\) and \(50\) (in seconds). Similarly, a new process of type C arrives at time \(t = 11, 22, 33, 44,\) and \(55\) (in seconds). The CPU scheduling policy is First Come First Serve (FCFS). The first process of type A starts running at \(t = 10\) seconds. The average waiting time (in seconds) for the 10 processes is ___________.
(Rounded off to one decimal place)

Show Hint

List all 10 arrivals in one combined, arrival-sorted timeline and simulate the single CPU: a process starts at max(its arrival time, the CPU's previous finish time).
Updated On: Jul 22, 2026
Show Solution

Correct Answer: 9.5

Solution and Explanation

Step 1 (Alternate method - completion time / turnaround time formula): Process the same 10 processes in arrival order and use CT(i) = max(CT(i-1), Arrival(i)) + Burst(i) for completion time, then Waiting(i) = CT(i) - Arrival(i) - Burst(i).

Step 2 (Order by arrival): A1(10,6), C1(11,8), A2(20,6), C2(22,8), A3(30,6), C3(33,8), A4(40,6), C4(44,8), A5(50,6), C5(55,8).

Step 3 (Completion times):
CT(A1) = max(idle, 10) + 6 = 16
CT(C1) = max(16, 11) + 8 = 24
CT(A2) = max(24, 20) + 6 = 30
CT(C2) = max(30, 22) + 8 = 38
CT(A3) = max(38, 30) + 6 = 44
CT(C3) = max(44, 33) + 8 = 52
CT(A4) = max(52, 40) + 6 = 58
CT(C4) = max(58, 44) + 8 = 66
CT(A5) = max(66, 50) + 6 = 72
CT(C5) = max(72, 55) + 8 = 80

Step 4 (Turnaround = CT - Arrival, then Waiting = Turnaround - Burst):
A1: TAT=6, WT=0; C1: TAT=13, WT=5; A2: TAT=10, WT=4; C2: TAT=16, WT=8; A3: TAT=14, WT=8; C3: TAT=19, WT=11; A4: TAT=18, WT=12; C4: TAT=22, WT=14; A5: TAT=22, WT=16; C5: TAT=25, WT=17.

Step 5 (Average): Sum of waiting times = 0+5+4+8+8+11+12+14+16+17 = 95. Average = 95 / 10 = 9.5 seconds, matching the direct simulation.

\[ \boxed{9.5} \]
Was this answer helpful?
2

Questions Asked in GATE CS exam