Only numericals on this page. Every question is reproduced with the marks and paper
that were actually printed on it, then solved step by step and independently re-solved by a
separate calculator. Where the printed source book disagrees with the re-solved result, the
re-solved value is the answer here and the printed figure is quoted inside a
Verification note. Theory for these mechanisms lives on
Unit I and Memory Management.
How to use this page
Symbol
Formula used on every answer here
CT
Completion Time — the instant the process finishes its last unit of CPU burst
TAT
TAT = CT − AT (Turnaround Time)
WT
WT = TAT − BT (Waiting Time)
Averages
Avg TAT = (Σ TAT) ÷ n · Avg WT = (Σ WT) ÷ n for n processes
Hit ratio
hits ÷ total references · Fault ratio = faults ÷ total references = 1 − hit ratio
Tie-break convention — stated once, used everywhere below
On a tie in burst or remaining time, the process that arrived earlier runs; if still
tied, the lower process number runs. Non-preemptive SJF picks the shortest burst among
the processes that have already arrived. This is the convention that reproduces the source
book's own correct answers (for example the Jan-2024 Round Robin result), so the disagreements flagged
below are source errors and not a clash of conventions.
1. CPU Scheduling
Gantt + CT / TAT / WT
Six scheduling numericals, one from each 2023–2025 paper. Every chart below obeys the single
tie-break convention stated once at the top of this page — on a tie in burst or remaining time the earlier
arrival runs, and if still tied the lower process number runs — and every worked answer shows
TAT = CT − AT, WT = TAT − BT and the two averages.
Unit I · CPU Scheduling numerical
Consider the following process: (P1 AT 0 BT 6 Pri 3; P2 AT 1 BT 4 Pri 1; P3 AT 2 BT 5 Pri 2; P4 AT 3 BT 8 Pri 4) Draw Gantt chart and find the average waiting time and average turnaround time: (i) SRTF Scheduling (ii) Round robin (time quantum: 3)
Recent PYQ — must doMid Term Nov 2023 · Q.4(b)5 MarksVery high
Show answer
Given data
Processes as printed in the question
Process
Arrival Time (AT)
Burst Time (BT)
Priority
P1
0
6
3
P2
1
4
1
P3
2
5
2
P4
3
8
4
Total CPU work = 6 + 4 + 5 + 8 = 23 units, and P1 arrives at 0 so the timeline
must start at 0 and end at 23 with no idle gap. Use that as a sanity check on any chart you draw.
Formulas used: TAT = CT − AT, WT = TAT − BT.
(i) SRTF — Shortest Remaining Time First (preemptive)
t = 0: only P1 is in the system → P1 runs 0–1 (remaining 5).
t = 1: P2 arrives with BT 4 < P1's remaining 5 → preempt P1, run P2.
t = 2: P3 arrives (5) but P2 has only 3 left → P2 continues.
t = 3: P4 arrives (8) but P2 has 2 left → P2 continues and finishes at t = 5. CT P2 = 5.
t = 5: remaining times are P1 = 5, P3 = 5, P4 = 8. Tie 5 ↔ 5 between P1 and P3 →
earlier arrival wins → P1 (AT 0) runs and finishes at t = 10. CT P1 = 10.
Ready-queue rule: a process that arrives during a slice is queued
before the process whose slice just expired.
Round Robin slice-by-slice
#
Slice
Time
Burst left after slice
Ready queue after this dispatch
1
P1
0–3
3
P2, P3, P4, P1
2
P2
3–6
1
P3, P4, P1, P2
3
P3
6–9
2
P4, P1, P2, P3
4
P4
9–12
5
P1, P2, P3, P4
5
P1
12–15
0 → CT P1 = 15
P2, P3, P4
6
P2
15–16
0 → CT P2 = 16
P3, P4
7
P3
16–18
0 → CT P3 = 18
P4
8
P4
18–21
2
P4
9
P4
21–23
0 → CT P4 = 23
empty
Check: 3+3+3+3+3+1+2+3+2 = 23 = total burst, and the chart ends at 23 with no idle.
P1
P2
P3
P4
P1
P2
P3
P4
P4
03691215161821END
P1P2P3P4
Round Robin q = 3 — CT / TAT / WT
Process
AT
BT
CT
TAT = CT − AT
WT = TAT − BT
P1
0
6
15
15
9
P2
1
4
16
15
11
P3
2
5
18
16
11
P4
3
8
23
20
12
Average
—
—
—
66 ÷ 4 = 16.50
43 ÷ 4 = 10.75
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. The question asks for SRTF and Round Robin (q = 3),
but the source book prints a Gantt chart for a different algorithm than the one asked —
it labels the answer "In SJF (Shortest Job First) Scheduling method … here is the non preemptive SJF"
and shows the schedule P2 P4 P1 P3 on the scale 0 1 3 6 9. That printed
schedule cannot be any correct answer here: P2 arrives at t = 1 yet is shown owning 0–1, and P4's burst
is 8 units yet is shown finishing by t = 3. The printed timeline also stops at 9 although the workload
is 23 units. The SRTF figures avg WT 6.00 / avg TAT 11.75 and Round Robin figures
avg WT 10.75 / avg TAT 16.50 above are the re-solved answers.
For reference, on this data FCFS and non-preemptive SJF coincide: CT 6/10/15/23, avg WT 6.25, avg TAT 12.00.
Assume the following workload in a system: (P1 AT 5 BT 5; P2 AT 4 BT 6; P3 AT 3 BT 7; P4 AT 1 BT 9; P5 AT 2 BT 2; P6 AT 6 BT 3) Draw a Gantt chart illustrating the execution of these jobs using Round Robin and Shortest Job first (SJF) scheduling algorithm and also calculate the average waiting time and average turnaround time. Highlight the advantages of each algorithm through the calculate metrics.
Recent PYQ — must doEnd Term Jan 2024 · Q.3(a)10 MarksHigh
Show answer
Note on the quantum: the question does not state a time quantum; the source
solution uses q = 3, so q = 3 is used here too. Always write that assumption in the answer.
Given data
Six-process workload as printed
Process
P1
P2
P3
P4
P5
P6
Arrival Time
5
4
3
1
2
6
Burst Time
5
6
7
9
2
3
Total CPU work = 5+6+7+9+2+3 = 32 units; the first arrival is at t = 1,
so the chart must contain one idle unit and finish at 1 + 32 = 33.
Formulas: TAT = CT − AT, WT = TAT − BT.
Round Robin, q = 3 — every slice
Round Robin slice list (idle 0–1 because nothing has arrived yet)
#
1
2
3
4
5
6
7
8
9
10
11
12
13
Slice
idle
P4
P5
P3
P2
P4
P1
P6
P3
P2
P4
P1
P3
Interval
0–1
1–4
4–6
6–9
9–12
12–15
15–18
18–21
21–24
24–27
27–30
30–32
32–33
P5's burst is only 2, so its slice is 4–6 (2 units, not 3); P1's last slice is
30–32 and P3's is 32–33 for the same reason. Sum of slices = 1+3+2+3+3+3+3+3+3+3+3+2+1 = 33 ✓.
idle
P4
P5
P3
P2
P4
P1
P6
P3
P2
P4
P1
P3
014691215182124273032END
IdleP4P5P3P2P1P6
Round Robin q = 3 — CT / TAT / WT
Process
AT
BT
CT
TAT = CT − AT
WT = TAT − BT
P1
5
5
32
27
22
P2
4
6
27
23
17
P3
3
7
33
30
23
P4
1
9
30
29
20
P5
2
2
6
4
2
P6
6
3
21
15
12
Average
—
—
—
128 ÷ 6 = 21.33
96 ÷ 6 = 16.00
SJF (non-preemptive) — dispatch order
t = 0–1 idle (first arrival is P4 at t = 1).
t = 1: only P4 (9) has arrived → it must run, even though it is the longest burst. CT P4 = 10.
t = 10: all six have arrived; shortest burst among P1 5, P2 6, P3 7, P5 2, P6 3 → P5. CT P5 = 12.
t = 12: shortest of P1 5, P2 6, P3 7, P6 3 → P6. CT P6 = 15.
t = 15: shortest of P1 5, P2 6, P3 7 → P1. CT P1 = 20.
t = 20: P2 (6) then P3 (7). CT P2 = 26, CT P3 = 33.
idle
P4
P5
P6
P1
P2
P3
011012152026END
IdleP4P5P6P1P2P3
SJF non-preemptive — CT / TAT / WT
Process
AT
BT
CT
TAT = CT − AT
WT = TAT − BT
P1
5
5
20
15
10
P2
4
6
26
22
16
P3
3
7
33
30
23
P4
1
9
10
9
0
P5
2
2
12
10
8
P6
6
3
15
9
6
Average
—
—
—
95 ÷ 6 = 15.83
63 ÷ 6 = 10.50
Advantages, shown by the metrics (as the question asks)
Metric
Round Robin q = 3
SJF non-preemptive
Which wins, and why it is an advantage
Avg waiting time
16.00
10.50
SJF — it never hands the CPU to a long job while a short one waits.
Avg turnaround time
21.33
15.83
SJF — short jobs leave the system sooner, so the queue drains faster.
Best individual WT
P5 = 2
P4 = 0
RR gives the small job the lowest waiting time; SJF starves it (8).
Worst individual WT
P3 = 23
P3 = 23
Both leave the long job waiting; RR's ceiling is bounded by the quantum, SJF's is not.
Context switches
13 dispatches
6 dispatches
SJF is cheaper; RR pays in switching overhead for its responsiveness.
Response guarantee
all six have started by t = 18
P6 arrives at 6 but first runs only at 12
RR's advantage: bounded response time, no starvation.
This one matches the book
The Round Robin answer above is an exact match with the printed source —
CT 32/27/33/30/6/21, Avg TAT = 128/6 = 21.33, Avg WT = 96/6 = 16. Only the book's stray
"Ready Queue P3, P1, P4, P2, …" line is inconsistent with its own chart; the chart and tables are right.
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated — this applies to the SJF half only, because the source
prints no usable SJF table for this question (one chart is shown for both algorithms). The re-solved
SJF figures are Avg WT 10.50 / Avg TAT 15.83. For completeness, FCFS on the same data
gives Avg WT 12.67 / Avg TAT 18.00.
Calculate average waiting and turnaround times by drawing the Gantt chart using FCFS, Preemptive SJF and RR (q = 2 ms). [Data as printed: P1 AT 3 BT 5 · P2 AT 5 BT 8 · P3 AT 1 BT 7 · P4 AT 2 BT 6]
Recent PYQ — must doMid Term Oct 2024 · Q.4(a)5 MarksHigh
Show answer
Given data
Processes as printed (times in ms)
Process
AT (ms)
BT (ms)
P1
3
5
P2
5
8
P3
1
7
P4
2
6
Total CPU work = 5+8+7+6 = 26 ms; first dispatch is at t = 1, so
every correct chart for this data must end at 27. Formulas: TAT = CT − AT, WT = TAT − BT.
FCFS — arrival order P3 → P4 → P1 → P2
0–1 idle (nothing has arrived). P3 arrives at 1 → runs 1–8 → CT P3 = 8.
Round Robin q = 2 slice list (arrivals queue before the preempted process)
#
Slice
Time
Left after slice
Ready queue after dispatch
—
idle
0–1
—
P3
1
P3
1–3
5
P4, P1, P3
2
P4
3–5
4
P1, P3, P2, P4
3
P1
5–7
3
P3, P2, P4, P1
4
P3
7–9
3
P2, P4, P1, P3
5
P2
9–11
6
P4, P1, P3, P2
6
P4
11–13
2
P1, P3, P2, P4
7
P1
13–15
1
P3, P2, P4, P1
8
P3
15–17
1
P2, P4, P1, P3
9
P2
17–19
4
P4, P1, P3, P2
10
P4
19–21
0 → CT P4 = 21
P1, P3, P2
11
P1
21–22
0 → CT P1 = 22
P3, P2
12
P3
22–23
0 → CT P3 = 23
P2
13
P2
23–25
2
P2
14
P2
25–27
0 → CT P2 = 27
empty
Check: 2×12 + 1 + 1 + 2 + 2 = 26 ms of CPU work, plus 1 ms idle at the
start = timeline ends at 27 ✓.
idle
P3
P4
P1
P3
P2
P4
P1
P3
P2
P4
P1
P3
P2
P2
013579111315171921222325END
IdleP3P4P1P2
Round Robin q = 2 — CT / TAT / WT
Process
AT
BT
CT
TAT = CT − AT
WT = TAT − BT
P1
3
5
22
19
14
P2
5
8
27
22
14
P3
1
7
23
22
15
P4
2
6
21
19
13
Average
—
—
—
82 ÷ 4 = 20.50 ms
56 ÷ 4 = 14.00 ms
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated — for the Preemptive SJF part. The book prints
Avg WT 8.00 ms / Avg TAT 14.50 ms (its table gives P1 CT 8, P2 CT 28, P3 CT 20, P4 CT 13).
It tie-broke the 3 ↔ 5 clash in favour of P1, but under "earlier arrival wins" P3 — which has 5 units
remaining at t = 3 and arrived first — keeps the CPU. Since SRTF is provably optimal for average waiting
time, the lower figure 7.50 ms / 14.00 ms is the correct one.
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated — for the Round Robin part too. The book prints
Avg WT 9.00 ms / Avg TAT 15.50 ms (CT P1 14, P2 23, P3 17, P4 19) and even marks its own
answer with **. Its Gantt ends at t = 23, but the total burst is 26 ms with the first
dispatch at t = 1, so the chart must end at 27: the printed schedule silently drops 4 ms of CPU work.
The correct averages are 14.00 ms / 20.50 ms.
Verification line: FCFS above is confirmed by the book (7.75 / 14.25) ✓ ·
every chart here ends at 27 ✓ · row sums 57, 31, 56, 30, 82, 56 re-added ✓.
Unit I · CPU Scheduling numerical · headline problem
Consider the following set of processes, with the CPU-burst time given in milliseconds. (A 0 12; B 3 8; C 5 5; D 7 1; E 9 11) Draw the Gantt charts illustrating the execution of these processes and find: (i) Average waiting time for these processes with the SJF, Shortest Remaining Time First, Round Robin (Time quantum = 3 ms) and FCFS scheduling algorithm. (ii) Average turn around time for these processes with the SJF, SRTF, Round Robin and FCFS algo.
Recent PYQ — must doEnd Term Dec 2024 · Q.3(a)6.5 MarksVery high
Why this is the headline: it is the only question in the set that asks for four
algorithms on one data table, so it is the cheapest way to revise FCFS, SJF, SRTF and RR together.
Show answer
Given data
Processes as printed (AT, BT in milliseconds)
Process
A
B
C
D
E
Arrival Time
0
3
5
7
9
Burst Time
12
8
5
1
11
Total CPU work = 12+8+5+1+11 = 37 ms and A arrives at 0, so
all four charts must end at 37 with no idle. Formulas: TAT = CT − AT, WT = TAT − BT.
1. FCFS — arrival order A → B → C → D → E
A owns the CPU from 0 (only process present) → 0–12, CT A = 12.
B 12–20 → CT 20 · C 20–25 → CT 25 · D 25–26 → CT 26 · E 26–37 → CT 37.
A
B
C
D
E
012202526END
ABCDE
FCFS — CT / TAT / WT
Process
AT
BT
CT
TAT = CT − AT
WT = TAT − BT
A
0
12
12
12
0
B
3
8
20
17
9
C
5
5
25
20
15
D
7
1
26
19
18
E
9
11
37
28
17
Average
—
—
—
96 ÷ 5 = 19.20 ms
59 ÷ 5 = 11.80 ms
2. SJF (non-preemptive)
t = 0: only A has arrived → A must run to completion: 0–12. CT A = 12.
t = 12: ready set B 8, C 5, D 1, E 11 → shortest is D (1) → 12–13.
t = 13: B 8, C 5, E 11 → C (5) → 13–18.
t = 18: B 8 < E 11 → B → 18–26, then E → 26–37.
Dispatch order A → D → C → B → E, exactly the order the book prints.
A
D
C
B
E
012131826END
ADCBE
SJF non-preemptive — CT / TAT / WT
Process
AT
BT
CT
TAT = CT − AT
WT = TAT − BT
A
0
12
12
12
0
B
3
8
26
23
15
C
5
5
18
13
8
D
7
1
13
6
5
E
9
11
37
28
17
Average
—
—
—
82 ÷ 5 = 16.40 ms
45 ÷ 5 = 9.00 ms
3. SRTF — Shortest Remaining Time First
Every preemption decision
At t
Running / remaining
New arrival
Decision
0
A 12
—
A runs
3
A 9 left
B 8
8 < 9 → preempt A, run B
5
B 6 left
C 5
5 < 6 → preempt B, run C
7
C 3 left
D 1
1 < 3 → preempt C, run D → D finishes at 8 (CT D = 8)
8
C 3 left
—
C resumes, finishes at 11 (CT C = 11)
9
E 11 arrives while B runs
E 11
B 6 < E 11 → B keeps the CPU, finishes at 17 (CT B = 17)
17
A 9, E 11
—
A shorter → A runs 17–26 (CT A = 26)
26
E 11
—
E runs 26–37 (CT E = 37)
A
B
C
D
C
B
A
E
03578111726END
ABCDE
SRTF — CT / TAT / WT
Process
AT
BT
CT
TAT = CT − AT
WT = TAT − BT
A
0
12
26
26
14
B
3
8
17
14
6
C
5
5
11
6
1
D
7
1
8
1
0
E
9
11
37
28
17
Average
—
—
—
75 ÷ 5 = 15.00 ms
38 ÷ 5 = 7.60 ms
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. The book prints Avg WT 10.60 ms / Avg TAT 18.00 ms
(its SRTF table is CT 37/20/13/8/36, TAT 37/17/8/1/27, WT 25/9/3/0/16). Its chart has
A finishing at 37 and E at 36 — impossible under the shortest-remaining-time rule:
E arrives at t = 9 with 11 units, so it can never overtake A, which already holds 9 remaining units
and arrived first. Re-solved values are 7.60 ms / 15.00 ms.
4. Round Robin, q = 3 ms — every slice
Round Robin q = 3 slice list
#
Slice
Time
Left after slice
Ready queue after dispatch
1
A
0–3
9
B, A
2
B
3–6
5
A, C, B
3
A
6–9
6
C, B, D, E, A
4
C
9–12
2
B, D, E, A, C
5
B
12–15
2
D, E, A, C, B
6
D
15–16
0 → CT D = 16
E, A, C, B
7
E
16–19
8
A, C, B, E
8
A
19–22
3
C, B, E, A
9
C
22–24
0 → CT C = 24
B, E, A
10
B
24–26
0 → CT B = 26
E, A
11
E
26–29
5
A, E
12
A
29–32
0 → CT A = 32
E
13
E
32–35
2
E
14
E
35–37
0 → CT E = 37
empty
Check: 3+3+3+3+3+1+3+3+2+2+3+3+3+2 = 37 ms = Σ burst, chart ends at 37 ✓.
A
B
A
C
B
D
E
A
C
B
E
A
E
E
036912151619222426293235END
ABCDE
Round Robin q = 3 — CT / TAT / WT
Process
AT
BT
CT
TAT = CT − AT
WT = TAT − BT
A
0
12
32
32
20
B
3
8
26
23
15
C
5
5
24
19
14
D
7
1
16
9
8
E
9
11
37
28
17
Average
—
—
—
111 ÷ 5 = 22.20 ms
74 ÷ 5 = 14.80 ms
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. The book prints Avg WT 14.20 ms / Avg TAT 21.60 ms
(CT 29/31/23/13/36, TAT 29/28/18/6/27, WT 17/20/13/5/16). Its own timeline is internally broken: it
shows E with 5 units left at t = 23 but then gives E only 3 units (31–34) plus 2 units (34–36),
and it never accounts for D's arrival ordering. The slice-by-slice re-simulation above
(0–3 A, 3–6 B, 6–9 A, 9–12 C, 12–15 B, 15–16 D, 16–19 E, 19–22 A, 22–24 C, 24–26 B, 26–29 E,
29–32 A, 32–35 E, 35–37 E) gives 14.80 ms / 22.20 ms.
Final comparison — the four algorithms side by side
Same workload, four policies (re-solved values)
Algorithm
Avg Waiting Time
Avg Turnaround Time
Dispatches
Book's printed WT / TAT
FCFS
11.80
19.20
5
11.80 / 19.20 — agrees
SJF (non-preemptive)
9.00
16.40
5
9.00 / 16.40 — agrees
SRTF
7.60 (best)
15.00 (best)
8
10.60 / 18.00 — wrong
Round Robin q = 3
14.80 (worst)
22.20 (worst)
14
14.20 / 21.60 — wrong
What the comparison is worth writing in the answer
SRTF wins both averages because it always runs the shortest remaining work (it is optimal for
average waiting time on a single CPU). Round Robin loses both because it trades time-for-fairness:
14 dispatches instead of 5, so the convoy effect is replaced by a bounded response time — D, which
waits 18 ms under FCFS, waits only 8 ms here. That fairness-for-average trade-off is the point of
the question.
Verification line: every chart ends at 37 = Σ burst ✓ · FCFS and SJF reproduce the
printed book figures exactly ✓ · row sums 96/59, 82/45, 75/38, 111/74 re-added ✓.
Unit I · CPU Scheduling numerical
Consider four processes with the following CPU bursts (in ms): P1-12, P2-7, P3-8, P4-6, P5-10, and the arrival time is 0 for all processes. (i) Using SJF and Round Robin scheduling (time quantum = 3), draw the Gantt chart. (ii) Compute waiting time and turnaround time for each process for both scheduling algorithms. (iii) Compare the results and reason about which is more efficient in this case.
Recent PYQ — must doMid Term Oct 2025 · Q.2(b)6 MarksHigh
Source wording bug, reproduced as printed: the question says
"four processes" and then lists five (P1–P5). Answer with five processes and note the slip.
Show answer
Given data
All arrival times are 0
Process
P1
P2
P3
P4
P5
Arrival Time
0
0
0
0
0
Burst Time (ms)
12
7
8
6
10
Total CPU work = 12+7+8+6+10 = 43 ms, every process is present at
t = 0, so both charts run from 0 to 43 with no idle. Since all AT = 0,
TAT = CT and WT = CT − BT here.
SJF (all arrived, so tie-break by lower process number is never needed)
Initial ready queue (all arrive together, so they join in number order):
P1, P2, P3, P4, P5.
Round Robin q = 3 slice list
#
Slice
Time
Left
Ready queue after dispatch
1
P1
0–3
9
P2, P3, P4, P5, P1
2
P2
3–6
4
P3, P4, P5, P1, P2
3
P3
6–9
5
P4, P5, P1, P2, P3
4
P4
9–12
3
P5, P1, P2, P3, P4
5
P5
12–15
7
P1, P2, P3, P4, P5
6
P1
15–18
6
P2, P3, P4, P5, P1
7
P2
18–21
1
P3, P4, P5, P1, P2
8
P3
21–24
2
P4, P5, P1, P2, P3
9
P4
24–27
0 → CT P4 = 27
P5, P1, P2, P3
10
P5
27–30
4
P1, P2, P3, P5
11
P1
30–33
3
P2, P3, P5, P1
12
P2
33–34
0 → CT P2 = 34
P3, P5, P1
13
P3
34–36
0 → CT P3 = 36
P5, P1
14
P5
36–39
1
P1, P5
15
P1
39–42
0 → CT P1 = 42
P5
16
P5
42–43
0 → CT P5 = 43
empty
Check: 3×13 + 1 + 2 + 1 = 39 + 4 = 43 ms ✓ (13 full quanta, plus the
short closing slices).
P1
P2
P3
P4
P5
P1
P2
P3
P4
P5
P1
P2
P3
P5
P1
P5
0369121518212427303334363942END
P1P2P3P4P5
Round Robin q = 3 — CT / TAT / WT
Process
AT
BT
CT
TAT = CT − AT
WT = TAT − BT
P1
0
12
42
42
30
P2
0
7
34
34
27
P3
0
8
36
36
28
P4
0
6
27
27
21
P5
0
10
43
43
33
Average
—
—
—
182 ÷ 5 = 36.40 ms
139 ÷ 5 = 27.80 ms
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. The book prints Avg WT 28.20 ms / Avg TAT 36.80 ms
(CT P4 27, P2 33, P3 39, P5 42, P1 43; WT 31/26/31/21/32). It mis-orders the last three slices:
with the queue written above, P3 finishes at 36 and P1 at 42, not P3 at 39 and P1 at 43.
Re-solved: 27.80 ms / 36.40 ms.
(iii) Comparison — which is more efficient here
Basis
SJF
Round Robin q = 3
More efficient
Avg waiting time
14.20 ms
27.80 ms
SJF (about half)
Avg turnaround time
22.80 ms
36.40 ms
SJF
Dispatches / context switches
5
16
SJF — RR pays 11 extra switches
Throughput (jobs per 43 ms)
same 5, but the queue drains sooner
5
SJF
Response time / fairness
P1 waits 31 ms before its only run
every process runs within the first 15 ms
RR
Conclusion worth writing: SJF is more efficient on both averages because all
processes are available at t = 0, so SJF can order them by burst exactly once and never look back;
RR costs an extra 13.6 ms of average waiting purely for the fairness of a bounded response time.
The comparison stands either way — even on the book's own (mis-ordered) figures SJF wins both averages.
Verification line: charts end at 43 = Σ burst ✓ · SJF numbers match the book
exactly (14.20 / 22.80) ✓ · RR row sums 139 ÷ 5 and 182 ÷ 5 ✓.
Unit I · CPU Scheduling numerical · four algorithms
Consider the following set of processes in the order P1, P2, P3, P4, P5 with Arrival time 0, 1, 2, 3, 4 and in the same order the CPU Burst time in milliseconds are given as 10, 9, 6, 7, 4. Their Priorities are 3, 5, 2, 1 and 4 respectively with 5 considered higher priority. Calculate the Average waiting time and Turnaround time using the following scheduling algorithms: (i) Shortest Remaining Time First (ii) Round Robin (q = 2) (iii) Shortest Job First (iv) Priority Scheduling (Preemptive type)
Recent PYQ — must doEnd Term Dec 2025 · Q.2(b)7 MarksVery high
Show answer
Given data
Higher priority number = higher priority (stated in the question)
Process
AT
BT (ms)
Priority
P1
0
10
3
P2
1
9
5 (highest)
P3
2
6
2
P4
3
7
1 (lowest)
P5
4
4
4
Total CPU work = 10+9+6+7+4 = 36 ms, P1 arrives at 0, so
all four charts run 0 → 36 with no idle. Formulas: TAT = CT − AT, WT = TAT − BT.
(i) SRTF — Shortest Remaining Time First
t = 0: P1 runs. t = 1: P2 arrives with 9 and P1 has 9 left → tie; P1 arrived earlier, so P1 keeps the CPU
(this single tie-break is where the book goes wrong).
t = 2: P3 arrives with 6 < P1's 8 → preempt P1. t = 3: P4 arrives (7) > P3's 5 → P3 continues.
t = 4: P5 arrives with 4 and P3 has 4 left → tie; P3 arrived earlier, so P3 continues
and finishes at t = 8 → CT P3 = 8.
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. The book prints Avg WT 11.80 ms / Avg TAT 19.00 ms
(its Gantt is 0–1 P1 | 1–4 P2 | 4–8 P5 | 8–14 P3 | 14–20 P2 | 20–27 P4 | 27–36 P1, CT P5 8, P3 14, P2 20,
P4 27, P1 36). It let P2 preempt P1 on a 9-vs-9 tie and P5 preempt P3 on a
4-vs-4 tie. Under the stated convention — on a tie the earlier arrival runs — both
preemptions are wrong, and because SRTF is optimal for average waiting time the lower figure
11.20 / 18.40 is the correct one.
(ii) Round Robin, q = 2 — every slice
Round Robin q = 2 slice list (arrivals queue before the preempted process)
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. The book prints Avg WT 22.80 ms / Avg TAT 30.00 ms
(CT P5 28, P3 30, P4 32, P1 34, P2 36; WT 24/26/22/22/20). Its 18-cell Gantt string accounts for only
part of the workload and its CT column for P5, P3 and P4 is 6 ms later than a correct simulation.
The slice list above is complete (19 dispatches, 36 units), so the re-solved averages are
21.40 ms / 28.60 ms.
(iii) SJF (non-preemptive)
t = 0: only P1 present → P1 runs 0–10 → CT P1 = 10.
t = 10: bursts available are P2 9, P3 6, P4 7, P5 4 → P5 first (4) → CT P5 = 14.
This half agrees with the book
The SJF and preemptive-Priority answers match the printed source (SJF 12.20 / 19.40 and
Priority 13.20 / 20.40). The book's priority Gantt — 0–1 P1, 1–10 P2, 10–14 P5, 14–23 P1, 23–29 P3,
29–36 P4 — reproduces exactly.
Four-algorithm comparison
Algorithm
Avg WT
Avg TAT
Note
SRTF
11.20 (best)
18.40 (best)
Optimal for average WT; 6 dispatches.
SJF (non-preemptive)
12.20
19.40
Close second; only 5 dispatches, cheapest.
Priority (preemptive)
13.20
20.40
Good for P2 (WT 0), unfair to P4 (WT 26) — starvation risk.
Round Robin q = 2
21.40 (worst)
28.60 (worst)
Fairest: every process has run by t = 12; 19 dispatches.
Priority (non-preemptive), same data
14.20
21.40
Reference only — not asked in this question.
Verification line: all four charts end at 36 = Σ burst ✓ · SJF and Priority
row sums 97/61 and 102/66 re-added ✓ · RR slice count 19 with 17×2 + 2×1 = 36 ✓.
2. Memory Allocation
First / best / worst fit
Unit II · Contiguous allocation numerical
Given Memory Partitions of 100K, 500K. 200K. 300K and 600K (in order), how would each of the first fit, best fit, and worst fit algorithms place processes of 212K, 417K, 112K and 426K (in order)? Which algorithms make the most efficient use of memory?
Recent PYQ — must doEnd Term Jul 2023 · Q.2(b)6.5 MarksVery high
Asked in: End Term [JULY 2023] Q.2(b) (6.5 marks) · 2016 paper Q.4 (marks not
printed on the question) · End Term [MAY–JUNE 2017] Q.2(b) (4 marks) · Dec-2025 Q.5(a) area —
identical data every time.
Show answer
Given data
Memory partitions in printed order, processes in printed order
Partition
P-1
P-2
P-3
P-4
P-5
Total
Size
100K
500K
200K
300K
600K
1700K
Process
1
2
3
4
Total
Size
212K
417K
112K
426K
1167K
Rules to state before you start: first-fit = the first partition
(scanning in address order) that is big enough; best-fit = the smallest partition that is
big enough; worst-fit = the largest partition available. A process that fits nowhere must
wait. Total memory 1700K vs total demand 1167K, so the failures below are about fragmentation,
not capacity.
First-fit
Process
Size
Allocated Block
Remaining Space
1
212K
500K block (2nd)
288K
2
417K
600K block (5th)
183K
3
112K
288K hole in the 500K block
176K
4
426K
— must wait
free list 100K, 176K, 200K, 300K, 183K
Why 426K waits: the 100K, 176K, 200K, 300K and 183K holes are all smaller than 426K.
959K of the 1167K requested is placed; 426K is left out even though 959K of free space exists in total —
external fragmentation.
Best-fit
Process
Size
Allocated Block
Remaining Space
1
212K
300K block (4th)
88K
2
417K
500K block (2nd)
83K
3
112K
200K block (3rd)
88K
4
426K
600K block (5th)
174K
Free list after all four placements: 100K, 83K, 88K, 88K, 174K.
Worst-fit
Process
Size
Allocated Block
Remaining Space
1
212K
600K block (5th)
388K
2
417K
500K block (2nd)
83K
3
112K
388K hole in the 600K block
276K
4
426K
— must wait
free list 100K, 83K, 200K, 300K, 276K
Worst-fit deliberately keeps the largest leftover, but it burns the only two blocks
that a 426K request could ever have fitted into whole.
Answer to "which makes the most efficient use of memory"
Policy
Processes placed
Total allocated
Leftover fragment list
Verdict
First-fit
3 of 4
741K
100K, 176K, 200K, 300K, 183K
426K waits
Best-fit
4 of 4
1167K
100K, 83K, 88K, 88K, 174K
only policy that places all four
Worst-fit
3 of 4
741K
100K, 83K, 200K, 300K, 276K
426K waits
Best-fit is the only policy that places all four processes, so it makes the most
efficient use of memory on this data set — exactly the conclusion printed in the 2016 paper:
"Best-fit algorithm makes the most efficient use of memory. It is the only [one] capable of meeting
all memory requests in this case."
Fig NUM-1 · How best-fit lands the four processes
How to draw this in exam
Draw one long rectangle split into five blocks labelled 100K, 500K, 200K, 300K, 600K in that order.
Under it, draw the same five blocks and shade the part each process occupies; write the leftover size inside the block.
Do one policy at a time and re-draw the free list after every placement — that is where marks are lost.
Finish with the one-line verdict: best-fit places all four.
Warning — do not copy the May–June 2017 printed answer
The same data was asked twice, and the two printed answers contradict each other. The
May–June 2017 solution states 212K → 500K (288 left) under
best-fit, then claims 112K and 426K both find "No Space", and concludes
"The best fit and First Fit algorithms uses memory most efficiently."
That cannot be right: 212K's best fit among 100K/500K/200K/300K/600K is the
300K block (88K left), not the 500K block, and once 212K is put in 300K the 600K
block stays whole for 426K. The 2016 printed answer agrees with the
independently re-solved table above.
Verification line: every policy trace re-ran from the free list
100K, 500K, 200K, 300K, 600K; best-fit consumes 1167K with fragments 100+83+88+88+174 = 533K, and
1167 + 533 = 1700K = total memory ✓. First-fit and worst-fit each place 212+417+112 = 741K and leave
426K waiting ✓.
Theory behind this — contiguous allocation, internal vs external fragmentation and
compaction → Memory Management.
3. Paging / Address Translation
Address arithmetic
The four rules every paging arithmetic question uses
Quantity
Rule
Worked once (page size 16 B, logical space 4096 B, memory 512 B)
Fig NUM-2 · Splitting a logical address into page number + offset
How to draw this in exam
Two stacked strips: logical address on top, physical below; each split into two boxes.
Label the left boxes "page number" and "frame number", the right boxes both "offset d".
Arrow from the page-number box into a small "page table" box, then arrow out to the frame number.
Write the two formulas in the margin: offset bits = log2(page size); physical bits = log2(frames) + offset bits.
Unit II · Paging address arithmetic
Consider a logical address space of eight pages of 1024 words each, mapped onto a physical memory of 32 frames. (i) How many bits are there in the logical address? (ii) How many bits are there in physical address?
Recent PYQ — must doEnd Term Dec 2024 · Q.5(b)3 MarksVery high
Show answer
Given data
Item
Value as printed
Number of pages
8
Page size
1024 words
Physical memory
32 frames (frame size = page size = 1024 words)
Solution
Logical address space = 8 pages × 1024 words = 8192 words.
Bits in the physical address = log2(32768) = 15 bits.
Split check: frame bits log2 32 = 5, offset bits 10, and 5 + 10 = 15 ✓.
Address structure
Address
Page / frame field
Offset field
Total bits
Logical
3 bits (8 pages)
10 bits (1024 words)
13
Physical
5 bits (32 frames)
10 bits (1024 words)
15
Verification note
Verification note: the printed source result agrees with the re-solved values —
logical 13 bits (8192 words) and physical 15 bits (32768 words).
No correction needed on this question.
Verification line: 2¹³ = 8192 ✓ · 2¹⁵ = 32768 ✓ · offset bits identical on both
sides of the translation ✓.
Unit II · Paging / page-table arithmetic
A process contains a logical address space of 4096 bytes. Main memory size is 512 bytes. If the process is divided into fixed size partition of 16 byte each then (a) what will be size of offset/displacement bits? (b) How many pages are there in the process? (c) How much internal fragmentation will occur? (d) Find out the number of entries in general page table (e) How many entries will be there if the page table is an inverted one then?
Older PYQ — syllabus gapFirst Term Feb 2019 · Q.410 MarksHigh
Show answer
Given data
Item
Value
Power of 2
Logical address space
4096 bytes
2¹²
Main (physical) memory
512 bytes
2⁹
Page / partition size
16 bytes
2⁴
Solution, part by part
Part
Working
Answer
Logical address bits
log2 4096
12 bits
(a) Offset bits
log2(page size) = log2 16
4 bits
(b) Number of pages
4096 ÷ 16 = 2¹² ÷ 2⁴ = 2⁸
256 pages
(c) Internal fragmentation
4096 = 256 × 16 exactly, so the last page is full: 16 − 16 = 0
an inverted page table has one entry per frame, not per page
32 entries
Page-number bits check
logical bits − offset bits = 12 − 4
8 bits = log2 256 ✓
Verification note
Verification note: the printed source result appears inconsistent and the solution above was
independently recalculated — but only because the book prints no number at all for part (c)
(it writes the heading "No. Internal fragmentation" and then moves on). The re-solved value is
0 bytes, because 4096 is an exact multiple of 16 and no page is left partly empty.
Every other part of the printed answer (offset 4, pages 256, entries 256, frames 2⁵ = 32,
inverted entries 2⁵) agrees with the values above.
Unit II · Paging / page-table arithmetic · source answer broken
A process contains a logical address space of 4050 bytes. Main memory size is 1024 bytes. If the process is divided into fixed size partitions of 16 byte each then. (a) What will be size of offset/displacement bits? (b) How many pages are there in the process? (c) How much internal fragmentation will occur? (d) Find out number of entries in general page table. (e) If the page table in inverted one then how many entries will be there?
Older PYQ — important variantFirst Term Feb 2018 · Q.410 MarksHigh
Same template as Feb-2019 Q.4 above, with a process size that is not
an exact multiple of the page size — which is exactly why the fragmentation part matters.
last page holds 4050 − 253×16 = 2 of 16 bytes → 16 − 2
14 bytes
Physical address bits
log2 1024
10 bits
Number of frames
physical memory ÷ frame size = 1024 ÷ 16
64 frames
(d) General page table entries
one entry per page
254 entries
(e) Inverted page table entries
one entry per frame
64 entries
Page-number bits check
12 − 4 = 8 bits, and 2⁸ = 256 ≥ 254 pages ✓
8 bits
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. The book prints 4050/16 = 253.125 = 2^8 for the page count
(253.125 is not a power of 2, and a process cannot own a fraction of a page) and prints
16 − 2 = 8 byte for internal fragmentation (the subtraction itself gives 14, not 8).
The re-solved figures are 254 pages and 14 bytes of internal
fragmentation, with 64 frames / 64 inverted-page-table entries.
Verification line: 253 × 16 + 2 = 4050 ✓ · 254 pages × 16 B = 4064 B = 4050 + 14 wasted ✓ ·
64 frames × 16 B = 1024 B ✓.
Unit II · Segmentation with paging address bits
In a system using paging and segmentation, the virtual address space consists of up to 8 segments where each segment can be upto 2²⁹ bytes long. The hardware pages each segment into 256 byte pages. How many bits in the virtual address specify the following: (i) Segment number (ii) Page number (iii) Offset within page (iv) Entire Virtual address
Older PYQ — syllabus gapEnd Term Jun 2019 · Q.2(b)4 MarksMedium
Verification note
Verification note: the printed source result agrees with the re-solved values here —
segment 3, page 21, offset 8, total
32 bits. (One line of the printed working reads "for 28 byte page" only because the
superscript on 2⁸ is lost in the scan; the arithmetic actually used is 2⁸ = 256, as above.)
For a paged system, TLB hit ratio is 0.8. Let the RAM access time 't' be 100ns and the TLB access time 'T' be 50 ns. Calculate effective memory access time (with TLB).
Older PYQ — syllabus gapFirst Term Feb 2019 · Q.3(a)5 MarksHigh
Show answer
Given data
Item
Symbol
Value
TLB hit ratio
h
0.8
Main memory (RAM) access time
t
100 ns
TLB (associative register) access time
T
50 ns
Solution
TLB hit path: search the TLB, then use the frame from the TLB to fetch the word
from memory → T + t = 50 + 100 = 150 ns. Probability 0.8.
TLB miss path: search the TLB (50), read the page table from memory (100),
reload the TLB, then read the required word from memory (100) → T + 2t = 50 + 200 =
250 ns. Probability 1 − 0.8 = 0.2.
Verification note
Verification note: the printed source result agrees — the book's chain
0.8 × 150 + 0.2 × 250 = 120.0 + 50.0 = 170.0 ns is reproduced by the independent
re-solver exactly. Note the model assumption to state in the exam: a miss costs
two memory accesses (page table + the word itself).
Verification line: 0.8 × 150 = 120 ✓ · 0.2 × 250 = 50 ✓ · 120 + 50 = 170 ns ✓ ·
EAT must lie between the hit path (150) and the miss path (250) ✓.
Unit II · Demand paging EAT · broken source answer
If the average page fault service time of 25 ms and a memory access time of 100ns. Calculate the effective access time.
Older PYQ — important variantEnd Term Jun 2019 · Q.1(h)2.5 MarksMedium
Show answer
Given data
Item
Value
In nanoseconds
Average page-fault service time
25 ms
25 × 10⁶ = 25,000,000 ns
Memory access time
100 ns
100 ns
Solution
Convert to one unit first — that is the whole trick in this question.
1 ms = 10⁶ ns, so 25 ms = 25,000,000 ns.
Access that takes the page-fault path costs service time + the memory access that follows it:
25,000,000 + 100 = 25,000,100 ns ≈ 25 ms.
An access with no page fault costs just 100 ns.
With a page-fault rate p the general expression is
EAT = (1 − p) × 100 ns + p × 25,000,100 ns. The question does not give p,
so the only figure that can be produced from the printed data is the single faulting-access
total, 25,000,100 ns.
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. The book adds the two numbers with no unit conversion at all:
"Effective access time = Page fault service time + memory access time. = 25 + 100 = 125 ns."
That is dimensionally wrong — 25 is milliseconds and 100 is nanoseconds. Expressed in one unit the sum
is 25,000,100 ns (≈ 25 ms), not 125 ns.
Verification line: 25 ms = 25 × 10⁶ ns ✓ · 25,000,000 + 100 = 25,000,100 ns ✓ ·
a page fault is about 250,000 × more expensive than a clean memory access — which is the point the
question is really testing.
Unit II · TLB hit ratio from a target EAT · broken source answer
On a simple paged system, associative registers hold the most active page entries & full page table is stored in the main memory. If the references satisfied by the associative registers take 100ns & reference through the main memory page table take 180ns. What must be the hit ratio to be achieved on effective access time of 125ns?
Older PYQ — important variantEnd Term Jul 2016 · Q.2(b)Marks: not clearly visibleMedium
Show answer
Given data
Item
Value
Time for a reference satisfied by the associative registers (TLB hit)
100 ns
Time for a reference made through the main-memory page table
180 ns
Target effective access time
125 ns
Unknown
hit ratio x
Solution
A hit costs the associative-register time only: 100 ns.
A miss costs the page-table search in memory and then the required access:
100 + 180 = 280 ns.
Set up the weighted average and solve:
125 = 100x + 280(1 − x) = 280 − 180x
→ 180x = 155 → x = 155 ÷ 180 = 0.861.
So the associative registers must catch about 86.1 % of the references.
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. The book writes
EAT = [x*(m₁+m₂)] + [(1-x)*(c+m₁+m₂)] and then substitutes
125 = (280x) + (460-460x), giving 180x = 335 and
x = 1.86 (Hit Ratio). A hit ratio of 1.86 is impossible — it is larger
than 1 — because the book double-counted the associative-register time on both branches
(hit 280, miss 460), which also makes the target 125 ns unreachable. With the correct costs of
100 ns (hit) and 280 ns (miss) the required hit ratio is x ≈ 0.861.
All ten reference strings on this page at a glance
Fault counts are the independently re-solved values. Bold = the minimum for that string.
✅ = printed source agrees · ❌ = printed source disagrees · ⚠ = printed source answer not usable.
#
Paper · question
Frames
FIFO
LRU
Optimal
Best
P1
Oct-2024 Mid Q.2(b) · 18 refs
3
13 ❌
12 ✅
9 ✅
Optimal
P2
Jan-2024 End Q.5(b) · 20 refs
4
10
8
8
LRU = Optimal
P3
Dec-2024 End Q.5(a) ≡ Nov-2023 Mid Q.2(a) · 20 refs
3
16 ✅
15 ✅
11 ✅
Optimal
P4
Oct-2025 Mid Q.4(b) · 12 refs
3
9 ✅
10 ✅
7 ✅
Optimal
P5
Dec-2025 End Q.4(b) · 18 refs (letters)
4
13 ✅
10 ✅
8 ✅
Optimal
P6
Feb-2019 Q.3(b) · 15 refs, Optimal only
3
—
—
8 ✅
Optimal (only one asked)
P7
Jun-2019 Q.3(b) · 20 refs
3
—
18 ✅
13 ✅
Optimal (MFU 15 ❌)
P8
Feb-2018 Q.3(b) · 10 refs, LRU only
3
—
6 ✅
—
LRU (only one asked)
P9
May-2016 Q.3(a) · 20 refs
3
14 ✅
11 ✅
—
LRU (of the two asked)
P10
Jul-2023 End Q.3(c) · 20 refs
4
10
8
8
LRU = Optimal · the Belady string
Rule
What to write
Fault
The referenced page is not resident → load it (a frame may have to be evicted). The first k distinct pages of any string are always faults when the k frames start empty.
Hit
The page is already resident → no load, no replacement.
Hits + faults
= number of references. Use it as the arithmetic check on every trace.
Hit ratio
hits ÷ references · Fault ratio = faults ÷ references = 1 − hit ratio
Replacement victim
FIFO = the page loaded longest ago · LRU = the page unused for longest · Optimal = the page not needed for longest in the future (not implementable; it is the yardstick).
Unit II · Page replacement numerical · headline
Consider the page reference string: 1, 0, 7, 1, 0, 2, 1, 2, 3, 0, 3, 2, 4, 0, 3, 6, 2, 1 for a memory with three frames. Determine the number of page faults using the FIFO, Optimal, and LRU replacement algorithms. Which algorithm is most efficient?
Recent PYQ — must doMid Term Oct 2024 · Q.2(b)5 MarksVery high
Victim = the page that has been resident longest. Faults land on references
1, 2, 3, 6, 7, 9, 10, 12, 13, 15, 16, 17, 18.
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Page
1
0
7
1
0
2
1
2
3
0
3
2
4
0
3
6
2
1
F1
1
1
1
1
1
2
2
2
2
0
0
0
0
0
3
3
3
1
F2
–
0
0
0
0
0
1
1
1
1
1
2
2
2
2
6
6
6
F3
–
–
7
7
7
7
7
7
3
3
3
3
4
4
4
4
2
2
Result
F
F
F
H
H
F
F
H
F
F
H
F
F
H
F
F
F
F
LRU — frame-by-frame trace
Victim = the resident page whose most recent use is furthest back.
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Page
1
0
7
1
0
2
1
2
3
0
3
2
4
0
3
6
2
1
F1
1
1
1
1
1
1
1
1
1
0
0
0
4
4
4
6
6
6
F2
–
0
0
0
0
0
0
0
3
3
3
3
3
0
0
0
2
2
F3
–
–
7
7
7
2
2
2
2
2
2
2
2
2
3
3
3
1
Result
F
F
F
H
H
F
H
H
F
F
H
H
F
F
F
F
F
F
Optimal — frame-by-frame trace
Victim = the resident page whose next use is furthest in the future
(or never again). Look ahead in the string before every replacement.
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Page
1
0
7
1
0
2
1
2
3
0
3
2
4
0
3
6
2
1
F1
1
1
1
1
1
1
1
1
3
3
3
3
3
3
3
6
2
1
F2
–
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
F3
–
–
7
7
7
2
2
2
2
2
2
2
4
4
4
4
4
4
Result
F
F
F
H
H
F
H
H
F
H
H
H
F
H
H
F
F
F
Results
18 references, 3 frames
Algorithm
Page faults
Hits
Hit ratio
Fault ratio
Printed in the book
FIFO
13
5
5 ÷ 18 = 0.278
13 ÷ 18 = 0.722
12 ❌
LRU
12
6
6 ÷ 18 = 0.333
12 ÷ 18 = 0.667
12 ✅
Optimal
9
9
9 ÷ 18 = 0.500
9 ÷ 18 = 0.500
9 ✅
Most efficient: Optimal with 9 faults (fault ratio 0.500), then LRU with 12, then FIFO
with 13. Optimal is a benchmark only — it needs the future, so it cannot be implemented; among the
implementable policies on this string the better one is LRU.
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. For FIFO the book's own step table lists 13 rows marked "Yes"
(a fault) and then writes "Total Page Faults (FIFO) = 12". The re-solved trace above faults 13
times and the printed table itself contains those 13 fault rows, so 13 is the answer to
publish, not 12. LRU = 12 and Optimal = 9 are printed correctly and are confirmed.
Consider there are 3 frames allocated to a process and the page reference string is: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6. How many page faults would occur for the FIFO, LRU and OPTIMAL page replacement algorithms?
Recent PYQ — must doEnd Term Dec 2024 · Q.5(a)6.5 MarksVery high
Asked in: Dec-2024 End Q.5(a) (6.5 marks) and Nov-2023 Mid Q.2(a) — the
Nov-2023 copy prints the same string but is cut off at the page gutter and points here
("Refer Q5(a) End Term Exam Dec. 2024"). The identical string also appears as Feb-2017 Q.2(b) and
May–June 2017 Q.3(a) (5 marks), where the printed answers are FIFO 16, LRU 15, Optimal 11.
1, 2, 3, 4, 5, 6, 7 → 7 different pages must pass through 3 frames
FIFO — frame-by-frame trace
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Page
1
2
3
4
2
1
5
6
2
1
2
3
7
6
3
2
1
2
3
6
F1
1
1
1
4
4
4
4
6
6
6
6
3
3
3
3
2
2
2
2
6
F2
–
2
2
2
2
1
1
1
2
2
2
2
7
7
7
7
1
1
1
1
F3
–
–
3
3
3
3
5
5
5
1
1
1
1
6
6
6
6
6
3
3
Result
F
F
F
F
H
F
F
F
F
F
H
F
F
F
H
F
F
H
F
F
LRU — frame-by-frame trace
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Page
1
2
3
4
2
1
5
6
2
1
2
3
7
6
3
2
1
2
3
6
F1
1
1
1
4
4
4
5
5
5
1
1
1
7
7
7
2
2
2
2
2
F2
–
2
2
2
2
2
2
6
6
6
6
3
3
3
3
3
3
3
3
3
F3
–
–
3
3
3
1
1
1
2
2
2
2
2
6
6
6
1
1
1
6
Result
F
F
F
F
H
F
F
F
F
F
H
F
F
F
H
F
F
H
H
F
Optimal — frame-by-frame trace
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Page
1
2
3
4
2
1
5
6
2
1
2
3
7
6
3
2
1
2
3
6
F1
1
1
1
1
1
1
1
1
1
1
1
3
3
3
3
3
3
3
3
6
F2
–
2
2
2
2
2
2
2
2
2
2
2
7
7
7
2
2
2
2
2
F3
–
–
3
4
4
4
5
6
6
6
6
6
6
6
6
6
1
1
1
1
Result
F
F
F
F
H
H
F
F
H
H
H
F
F
H
H
F
F
H
H
F
Results
20 references, 3 frames
Algorithm
Page faults
Hits
Hit ratio
Fault ratio
Printed in the book
FIFO
16
4
4 ÷ 20 = 0.200
16 ÷ 20 = 0.800
16 ✅
LRU
15
5
5 ÷ 20 = 0.250
15 ÷ 20 = 0.750
15 ✅
Optimal
11
9
9 ÷ 20 = 0.450
11 ÷ 20 = 0.550
11 ✅
Best: Optimal (11 faults). Between the two implementable policies, LRU (15) beats
FIFO (16) on this string — the locality of 2, 1, 2 in the middle of the string is exactly what LRU
exploits and FIFO ignores.
Verification note
Verification note: the printed source result agrees with all three re-solved counts
(FIFO 16, LRU 15, Optimal 11), and the printed frame grids reproduce cell for cell. This is the one
headline page-replacement question in the set with no arithmetic error in it.
Verification line: 16 + 4 = 20 ✓ · 15 + 5 = 20 ✓ · 11 + 9 = 20 ✓ ·
hits are the references that repeat a resident page: FIFO hits at references 5, 11, 15, 18.
Unit II · Page replacement numerical · headline
Consider the Reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5, with 3 available page frames. Calculate the number of page faults using the following page replacement techniques: (i) LRU (ii) Optimal (iii) FIFO
Recent PYQ — must doMid Term Oct 2025 · Q.4(b)5 MarksVery high
Show answer
Given data
Item
Value
Reference string (12 references)
1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5
Frames
3, initially empty
FIFO — frame-by-frame trace
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
Page
1
2
3
4
1
2
5
1
2
3
4
5
F1
1
1
1
4
4
4
5
5
5
5
5
5
F2
–
2
2
2
1
1
1
1
1
3
3
3
F3
–
–
3
3
3
2
2
2
2
2
4
4
Result
F
F
F
F
F
F
F
H
H
F
F
H
LRU — frame-by-frame trace
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
Page
1
2
3
4
1
2
5
1
2
3
4
5
F1
1
1
1
4
4
4
5
5
5
3
3
3
F2
–
2
2
2
1
1
1
1
1
1
4
4
F3
–
–
3
3
3
2
2
2
2
2
2
5
Result
F
F
F
F
F
F
F
H
H
F
F
F
Optimal — frame-by-frame trace
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
Page
1
2
3
4
1
2
5
1
2
3
4
5
F1
1
1
1
1
1
1
1
1
1
3
4
4
F2
–
2
2
2
2
2
2
2
2
2
2
2
F3
–
–
3
4
4
4
5
5
5
5
5
5
Result
F
F
F
F
H
H
F
H
H
F
F
H
Results
12 references, 3 frames
Algorithm
Page faults
Hits
Hit ratio
Fault ratio
Printed in the book
FIFO
9
3
3 ÷ 12 = 0.250
9 ÷ 12 = 0.750
9 ✅
LRU
10
2
2 ÷ 12 = 0.167
10 ÷ 12 = 0.833
10 ✅
Optimal
7
5
5 ÷ 12 = 0.417
7 ÷ 12 = 0.583
7 ✅
Best: Optimal (7 faults). Note the teaching point of this string: LRU is
worse than FIFO here (10 vs 9). LRU is not guaranteed to beat FIFO on every string — it is a
stack algorithm that rewards recent use, and the loop 1, 2, … 1, 2 keeps refreshing exactly the pages
FIFO was about to throw away.
Verification note
Verification note: the printed source result agrees — FIFO 9, LRU 10, Optimal 7 are
the printed figures and all three are reproduced by the independent re-simulation.
Consider the following reference string 5, 6, 1, 2, 6, 3, 6, 4, 2, 3, 6, 3, 2, 1, 2, 6, 1, 5, 6, 1. Find the number of Page Faults with FIFO, Optimal Page replacement and LRU with four free frames which are empty initially. Which algorithm gives the minimum number of page faults?
Recent PYQ — must doEnd Term Jan 2024 · Q.5(b)8 MarksVery high
Results (frame-by-frame trace: fill the four frames with 5, 6, 1, 2 over the first
four references, then replace by FIFO order / least-recently-used / farthest-future-use respectively)
20 references, 4 frames
Algorithm
Page faults
Hits
Hit ratio
Fault ratio
FIFO
10
10
10 ÷ 20 = 0.500
10 ÷ 20 = 0.500
LRU
8
12
12 ÷ 20 = 0.600
8 ÷ 20 = 0.400
Optimal
8
12
12 ÷ 20 = 0.600
8 ÷ 20 = 0.400
Answer to "which gives the minimum":LRU and Optimal tie at 8 faults —
do not write "Optimal alone". On this string the implementable policy (LRU) already reaches the optimal
bound, and FIFO is two faults worse.
Verification note
Verification note: the printed source result appears inconsistent, and the solution above was
independently recalculated. The book prints a single frame trace although three
algorithms are asked, its column headings ("Page | Frame | String | Page Fault") do not match the
columns it actually prints, and it concludes "Page faults 16." No re-solved algorithm on
4 frames reaches 16 on this string: the correct totals are FIFO 10, LRU 8, Optimal 8.
Verification line: 10 + 10 = 20 ✓ · 8 + 12 = 20 ✓ · 8 + 12 = 20 ✓ ·
minimum possible faults ≥ number of distinct pages = 6, and both LRU and Optimal land just above it.
Unit II · Page replacement numerical
Consider the following page Reference string A, B, C, D, B, A, E, F, B, A, B, C, E, G, C, B, A, B. How many page faults would occur for the following page replacement algorithms assuming four available frames? All frames are initially empty: (i) LRU (ii) FIFO (iii) Optimal page replacement.
Recent PYQEnd Term Dec 2025 · Q.4(b)Marks: not clearly visibleHigh
Asked in: End Term Dec 2025 · Q.4(b) (6 marks). Printed answers in the book:
FIFO 13, LRU 10, Optimal 8 — all three reproduce exactly under independent simulation.
Show answer
Given data
Item
Value
Reference string (18 references)
A, B, C, D, B, A, E, F, B, A, B, C, E, G, C, B, A, B
Frames
4, initially empty
Distinct pages
A, B, C, D, E, F, G → 7
Results
18 references, 4 frames
Algorithm
Page faults
Hits
Hit ratio
Fault ratio
Printed in the book
FIFO
13
5
5 ÷ 18 = 0.278
13 ÷ 18 = 0.722
13 ✅
LRU
10
8
8 ÷ 18 = 0.444
10 ÷ 18 = 0.556
10 ✅
Optimal
8
10
10 ÷ 18 = 0.556
8 ÷ 18 = 0.444
8 ✅
Best: Optimal (8 faults, hit ratio 0.556). LRU is the best implementable choice here
with 10; FIFO pays for ignoring the fact that A and B dominate the string.
Verification note
Verification note: the printed source result agrees — FIFO 13, LRU 10, Optimal 8 are
exactly the printed figures and all three are reproduced by the independent simulation.
Verification line: 13 + 5 = 18 ✓ · 10 + 8 = 18 ✓ · 8 + 10 = 18 ✓ ·
D, F and G appear once or twice, so they are the pages every algorithm keeps evicting.
Unit II · Page replacement numerical · includes MFU
Consider the following page reference string: 7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 7, 1, 0, 5, 4, 6, 2, 3, 0, 1. Assuming demand paging with three frames, how many page faults wcould occur for the following replacement algorithms? (i) LRU replacement (ii) MFU replacement (iii) Optimal replacement
Older PYQ — important variantEnd Term Jun 2019 · Q.3(b)5 MarksMedium
wcould is the book's own typo, reproduced as printed.
MFU = Most Frequently Used: evict the resident page with the highest reference count so far.
Best: Optimal (13). Of the implementable ones MFU (15) beats LRU (18) on this string,
which is a good illustration of why MFU exists as a counter-example: a page referenced very often in the
past may never be needed again, and MFU throws it out precisely for that reason.
Verification note
Verification note: the printed source result appears inconsistent for the MFU part,
and the trace was independently re-simulated. The book states 14 page faults for MFU
(its printed working reads 11 + III = 14 Page fault); re-running the count-based victim
choice frame by frame gives 15 faults and 5 hits (15 + 5 = 20 references).
LRU = 18 and Optimal = 13 are printed correctly and confirmed.
Verification line: 18 + 2 = 20 ✓ · 15 + 5 = 20 ✓ · 13 + 7 = 20 ✓ ·
the string has 8 distinct pages (0–7) passing through 3 frames, so a fault count this high is expected.
Unit II · Page replacement numerical · Optimal only
Calculate total number of page fault that will occur while processing the page reference string given below: 4, 6, 7, 1, 6, 7, 1, 2, 6, 2, 0, 3, 1, 4, 2 using Optimal page replacement policy, when page frames are Three.
Older PYQ — syllabus gapFirst Term Feb 2019 · Q.3(b)5 MarksMedium
Show answer
Given data
Item
Value
Reference string (15 references)
4, 6, 7, 1, 6, 7, 1, 2, 6, 2, 0, 3, 1, 4, 2
Frames
3, initially empty
Policy
Optimal only
Optimal working (how to choose the victim at each fault)
Reference 4 (page 1): 6 and 7 are needed again at references 5 and 6, page 4 not until 14 →
evict 4, load 1 → fault 4.
References 5–7 (6, 7, 1) are all hits — the pages Optimal chose to keep.
Reference 8 (page 2): frames hold 6, 7, 1. 6 is needed at 9, 1 at 13, 7 never again →
evict 7 → fault 5.
Reference 9 (6) hit · reference 10 (2) hit · reference 11 (0): frames 6, 1, 2 — 6 never used again →
evict 6 → fault 6.
Reference 12 (3): frames 0, 1, 2 — 2 next at 15, 1 at 13, 0 never again → evict 0
→ fault 7.
References 13 (1) and 14 (4): frames 3, 1, 2 — 3 never used again → evict 3, load 4
→ fault 8; page 1 is a hit.
Reference 15 (2) hit. Total = 8 page faults.
15 references, 3 frames, Optimal
Algorithm
Page faults
Hits
Hit ratio
Fault ratio
Printed in the book
Optimal
8
7
7 ÷ 15 = 0.467
8 ÷ 15 = 0.533
8 ✅
Best (and only policy asked): Optimal, 8 faults. Since Optimal is a lower bound for
any replacement policy on this string, no FIFO or LRU run can do better than 8 here.
Verification note
Verification note: the printed source result agrees — the book states
"total no. of page faults = 8" and the re-simulated trace gives 8 faults / 7 hits.
(The book's small trace boxes have some unreadable column digits Scan unclear — verify from the original PDF,
but the string, the frame count and the total are legible.)
Calculate total number of page fault that will occur while processing the page reference string given below : 4,7,6,1,7,6,1,2,7,2, using LRU page replacement policy, when page frames are three.
Older PYQ — syllabus gapFirst Term Feb 2018 · Q.3(b)5 MarksMedium
Show answer
Given data
Item
Value
Reference string (10 references)
4, 7, 6, 1, 7, 6, 1, 2, 7, 2
Frames
3, initially empty
Policy
LRU only
LRU working
Ref
Page
Frames after
Result
Victim chosen
1
4
4, –, –
F
filling
2
7
4, 7, –
F
filling
3
6
4, 7, 6
F
filling
4
1
4, 7, 6 → 1 replaces 4
F
4 (least recently used)
5
7
1, 7, 6
H
—
6
6
1, 7, 6
H
—
7
1
1, 7, 6
H
—
8
2
2 replaces 7 (7 used longest ago of 7, 6, 1)
F
7
9
7
7 replaces 6
F
6
10
2
1, 7, 2
H
—
10 references, 3 frames, LRU
Algorithm
Page faults
Hits
Hit ratio
Fault ratio
Printed in the book
LRU
6
4
4 ÷ 10 = 0.400
6 ÷ 10 = 0.600
6 ✅
Best of what is asked: LRU with 6 faults (hits at references 5, 6, 7, 10).
Verification note
Verification note: the printed source result agrees — "total no. of page faults = 6"
is reproduced exactly. The book's own 3-row grid on that page is partly illegible
Scan unclear — verify from the original PDF, so the table above was rebuilt
from the LRU rule rather than copied.
Unit II · Page replacement numerical (printed as an illustration)
Explain any two page replacements algorithms. Give an illustration. [Illustration printed with the answer: "e.g. consider frame size = 3", reference string 1, 2, 3, 2, 1, 5, 2, 1, 6, 2, 5, 6, 3, 1, 3, 6, 1, 2, 4, 3]
Older PYQ — syllabus gapEnd Term May 2016 · Q.3(a)5 MarksMedium
Note: the string is not given in the question stem — it is the worked
illustration printed inside the answer, with the totals "FIFO — Total 14 page faults" and
"LRU — Total 11 page faults".
Best of the two: LRU (11 faults). FIFO faults at references
1, 2, 3, 6, 8, 9, 10, 11, 13, 14, 16, 18, 19 and 20 — fourteen of them. LRU keeps 1, 2 and 3 resident
through the busy middle of the string, which is where its three extra hits come from.
Verification note
Verification note: the printed source result agrees. The independent simulation
reproduces the printed FIFO frame rows cell for cell (14 faults) and the LRU total of 11, which is
also what corroborates the transcription of the string from the scan.
Verification line: 14 + 6 = 20 ✓ · 11 + 9 = 20 ✓ · distinct pages
1, 2, 3, 4, 5, 6 = 6, so at least 6 faults are unavoidable.
Unit II · Page replacement numerical
Consider there are 4 frames allocated to a process and the page reference string is: 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1 Calculate the number of page faults for the FIFO and LRU page replacement algorithms.
Older PYQ — important variantEnd Term Jul 2023 · Q.3(c)6.5 MarksHigh
Best of the two asked: LRU (8 faults). Optimal also reaches 8, so LRU is at the
theoretical lower bound on this string.
Verification note
Verification note: the notes record no printed total for this question's FIFO and LRU
columns (only the question, the string and the frame count are legible), so there is nothing to compare
against. The figures above are the independently re-simulated values. This is the classic textbook
string used to demonstrate Belady's anomaly — see the card below.
Verification line: 10 + 10 = 20 ✓ · 8 + 12 = 20 ✓ · distinct pages
0, 1, 2, 3, 4, 7 = 6 ≤ 20 references, so 8 faults is close to the floor of 6.
Unit II · Belady's anomaly · older-paper only demonstration
What is Belady's Anomaly? Explain with the help of suitable examples.
Older PYQ — important variantEnd Term Jul 2016 · Q.2(c)Marks: not clearly visibleSafety
Older-only: this demonstration is taken from the Jul-2016 paper's own example
(also the Feb-2017 Q.1(d) "What is Belady's Anomaly", 2.5 marks). No 2023–2025 paper asks it as a numerical,
so treat it as insurance, not as a must-do.
Show answer
Belady's anomaly is the counter-intuitive behaviour of the FIFO
page-replacement algorithm in which increasing the number of allocated page frames can
increase the number of page faults. LRU does not suffer from it because it is a
stack algorithm: the pages held with k frames are always a subset of those held with
k+1 frames. Named after L. A. Belady, who reported it in 1969.
Given data
Item
Value
Reference string (12 references)
3, 2, 1, 0, 3, 2, 4, 3, 2, 1, 0, 4
Case 1 frames
3, initially empty
Case 2 frames
4, initially empty
Algorithm
FIFO in both cases — only the frame count changes
Case 1 — FIFO with 3 frames → 9 page faults
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
Page
3
2
1
0
3
2
4
3
2
1
0
4
F1
3
3
3
0
0
0
4
4
4
4
4
4
F2
–
2
2
2
3
3
3
3
3
1
1
1
F3
–
–
1
1
1
2
2
2
2
2
0
0
Result
F
F
F
F
F
F
F
H
H
F
F
H
Case 2 — FIFO with 4 frames → 10 page faults
Ref #
1
2
3
4
5
6
7
8
9
10
11
12
Page
3
2
1
0
3
2
4
3
2
1
0
4
F1
3
3
3
3
3
3
4
4
4
4
0
0
F2
–
2
2
2
2
2
2
3
3
3
3
4
F3
–
–
1
1
1
1
1
1
2
2
2
2
F4
–
–
–
0
0
0
0
0
0
1
1
1
Result
F
F
F
F
H
H
F
F
F
F
F
F
The anomaly, side by side
Frames
FIFO faults
Hits
Hit ratio
Fault ratio
3
9
3
3 ÷ 12 = 0.250
9 ÷ 12 = 0.750
4 (more memory)
10
2
2 ÷ 12 = 0.167
10 ÷ 12 = 0.833
One extra frame costs one extra fault. Reading the two traces: with 3 frames the
reference to page 3 at step 8 is a hit, because 3 is still resident; with 4 frames the loading
pattern has shifted and 3 was replaced at step 7, so the same reference faults. Mark the difference in
columns 7–8 of the two grids and the point makes itself.
Which is best overall on this string? Neither FIFO case makes the point — the anomaly is exactly the
argument for the stack property: LRU and Optimal can never fault more often when frames are added,
because the set of pages resident with k frames is always contained in the set resident with
k+1 frames. FIFO has no such guarantee, which is why its fault count went up from 9 to 10 above.
Verification note
Verification note: the printed source figure for this example is reproduced and confirmed
("In the first example (with fewer pages), there are 9 page faults" and 10 for the second),
although the sentence as printed is garbled — it reads "…there are 9 page faults, there are 10 page
faults" in one line, and the interior rows of the book's two frame stacks are misaligned in the scan
Scan unclear — verify from the original PDF. Both grids above were
rebuilt from the FIFO rule and independently re-simulated: 9 faults at 3 frames, 10 at 4 frames.
Verification line: Case 1 → 9 + 3 = 12 ✓ · Case 2 → 10 + 2 = 12 ✓ ·
the only requirement for demonstrating the anomaly is the same string, same algorithm, more frames, more faults.
Numericals Practice Checklist
Track
Ticks are saved in this browser and survive a refresh. Progress also feeds the dashboard.