The Gateway to Computer Science Excellence
+17 votes

A system uses FIFO policy for system replacement. It has $4$ page frames with no pages loaded to begin with. The system first accesses $100$ distinct pages in some order and then accesses the same $100$ pages but now in the reverse order. How many page faults will occur?

  1. $196$
  2. $192$
  3. $197$
  4. $195$
in Operating System by Veteran (105k points)
edited by | 2.8k views

2 Answers

+31 votes
Best answer

Answer is (A).

When we access the $100$ distinct page in some order (suppose order is $1 2 3$....$100$) then total page fault occurs are $100$. And in last, frame contain the pages $100 99 98 97$. When we reverse the string $(100,99,98....1)$ then first four page will not cause the page fault bcz they already present in frame but the remaining $96$ page will cause $96$ page fault,so total page fault are $100+96=196$.

by Active (4.1k points)
edited by

$\text{Page fault} = 100 + 96\:\text{(reverse order)} = 196$

Why first four misses are not included even though frame is empty ?
+1 vote
Answer will be "196" first 100 page fault will occur then 4 page hit after that 96 page fault total =100+96

If you want to visualize how this mapping take small value and check

1)Lets take 5 district element and its reveverse then page fault 5(page fault) + 4(page hit)+1 (page fault)

Total page fault=6

2) let's take 10 district element and its reveverse then 10(page fault)+4(page hit) +6(page fault)

Total page fault=16
by Loyal (8.7k points)
edited by

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,292 answers
104,909 users