GATE 2026 CS (CS1) – Question 64
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)
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 9.5
Explanation
List all 10 processes in order of arrival with their burst times:
1. $A_1$: arrival $t = 10$, burst = 6
2. $C_1$: arrival $t = 11$, burst = 8
3. $A_2$: arrival $t = 20$, burst = 6
4. $C_2$: arrival $t = 22$, burst = 8
5. $A_3$: arrival $t = 30$, burst = 6
6. $C_3$: arrival $t = 33$, burst = 8
7. $A_4$: arrival $t = 40$, burst = 6
8. $C_4$: arrival $t = 44$, burst = 8
9. $A_5$: arrival $t = 50$, burst = 6
10. $C_5$: arrival $t = 55$, burst = 8
Simulate FCFS execution:
- At $t = 10$: $A_1$ runs from $t = 10$ to $16$. Waiting time = $10 - 10 = 0\text{ s}$.
- At $t = 16$: $C_1$ (arrived at 11) is ready. Runs from $t = 16$ to $24$. Waiting time = $16 - 11 = 5\text{ s}$.
- At $t = 24$: $A_2$ (arrived at 20) and $C_2$ (arrived at 22) are in queue. $A_2$ runs from $t = 24$ to $30$. Waiting time = $24 - 20 = 4\text{ s}$.
- At $t = 30$: $C_2$ (arrived at 22) runs from $t = 30$ to $38$. Waiting time = $30 - 22 = 8\text{ s}$.
- At $t = 38$: $A_3$ (arrived at 30) runs from $t = 38$ to $44$. Waiting time = $38 - 30 = 8\text{ s}$.
- At $t = 44$: $C_3$ (arrived at 33) runs from $t = 44$ to $52$. Waiting time = $44 - 33 = 11\text{ s}$.
- At $t = 52$: $A_4$ (arrived at 40) runs from $t = 52$ to $58$. Waiting time = $52 - 40 = 12\text{ s}$.
- At $t = 58$: $C_4$ (arrived at 44) runs from $t = 58$ to $66$. Waiting time = $58 - 44 = 14\text{ s}$.
- At $t = 66$: $A_5$ (arrived at 50) runs from $t = 66$ to $72$. Waiting time = $66 - 50 = 16\text{ s}$.
- At $t = 72$: $C_5$ (arrived at 55) runs from $t = 72$ to $80$. Waiting time = $72 - 55 = 17\text{ s}$.
Sum of waiting times:
$$\sum W_i = 0 + 5 + 4 + 8 + 8 + 11 + 12 + 14 + 16 + 17 = 95\text{ seconds}$$
Average waiting time:
$$\bar{W} = \frac{95}{10} = 9.5\text{ seconds}$$
The correct answer is 9.5.