The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+13 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 (101k points)
edited by | 1.9k views

2 Answers

+24 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
+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 napping 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 (7.9k points)

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

39,529 questions
46,674 answers
57,587 users