The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+14 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$
asked in Operating System by Veteran (97.4k points)
edited by | 2.5k views

2 Answers

+26 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$.

answered by Active (4.1k points)
edited by

$Page$ $fault = 100+96(reverse$  $order)=196$

+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
answered by Loyal (8.3k 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
49,807 questions
54,506 answers
74,944 users