edited by
12,112 views
23 votes
23 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$
edited by

2 Answers

Best answer
41 votes
41 votes

Answer is (A).

When we access $100$ distinct page in some order (for example $1,2,3\ldots 100$) then total number of page faults $=100$. At last, the $4$ page frames will contain the pages $100,99,98$ and $97$. When we reverse the string $(100,99,98,\ldots,1)$ then first four page accesses will not cause the page fault because they are already present in page frames. But the remaining $96$ page accesses will cause $96$ page faults. So, total number of page faults $=100+96=196$.

edited by
1 votes
1 votes
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
edited by
Answer:

Related questions

61 votes
61 votes
6 answers
2
go_editor asked Sep 30, 2014
25,781 views
The following program consists of $3$ concurrent processes and $3$ binary semaphores. The semaphores are initialized as $S0=1, S1=0$ and $S2=0.$$$\begin{array}{|l|l|}\hli...