Log In
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
edited by

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

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

edited by

Related questions

95 votes
5 answers
A system has $n$ resources $R_0, \dots,R_{n-1}$, and $k$ processes $P_0, \dots, P_{k-1}$. The implementation of the resource request logic of each process $P_i$ ... $n=40,\: k=26$ $n=21,\:k=12$ $n=20,\:k=10$ $n=41,\:k=19$
asked Sep 30, 2014 in Operating System jothee 11.5k views
38 votes
5 answers
The following program consists of $3$ concurrent processes and $3$ binary semaphores. The semaphores are initialized as $S0=1, S1=0$ and $S2=0.$ ... $P0$ print '$0$'? At least twice Exactly twice Exactly thrice Exactly once
asked Sep 30, 2014 in Operating System jothee 8.9k views
29 votes
3 answers
Consider the methods used by processes $P1$ and $P2$ for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables $S1$ and $S2$ ... properties achieved? Mutual exclusion but not progress Progress but not mutual exclusion Neither mutual exclusion nor progress Both mutual exclusion and progress
asked Sep 29, 2014 in Operating System jothee 6.5k views
20 votes
3 answers
Consider the following heap (figure) in which blank regions are not in use and hatched region are in use. The sequence of requests for blocks of sizes $300, 25, 125, 50$ can be satisfied if we use either first fit or best fit policy (any one) first fit but not best fit policy best fit but not first fit policy None of the above
asked Oct 4, 2014 in Operating System Kathleen 3.4k views