edited by
28,671 views
76 votes
76 votes

A computer has twenty physical page frames which contain pages numbered $101$ through $120$. Now a program accesses the pages numbered $\text{1, 2, ..., 100}$ in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page replacement policy for this program?

  1. Least-recently-used
  2. First-in-first-out
  3. Last-in-first-out
  4. Most-recently-used
edited by

11 Answers

7 votes
7 votes

The page frame access sequence is

1,2,3.......19,20,21.....99,100,
1,2,3.......19,20,21.....99,100,
1,2,3.......19,20,21.....99,100,
1,2,3.......19,20,21.....99,100,

Using OPTIMAL replacement method from first 1....100 , first 20 page fault will take place as there are no common pages ,,from 21 to 100 again page fault will take place (these page fault will be equivalent to using MRU replacement method ). after these replacement the page frames will contain [1.....19,100] no pages .Considering the next sequence,no page fault from 1 to 19 and at the 20 page no ,19 will get replaced from the page frame and in the further sequence till 99 there will be page fault(these will be equivalent to using MRU ) and the resulting pages in frames will be 1...18 ,99,100 . going through the further sequence we will get the total page fault as 260 ......... replacing the pages using optimal method is equivalent to MRU replacement method thus answer (D)

7 votes
7 votes

Optimal PRA(Page Replacement Algorithm) behaves like MRU PRA  when the sequence is repeated only in case, where the frames are empty.

Here, the frames are already initialized with 101 to 120. So, none of the given options are correct.

 

4 votes
4 votes
OPTIMAL will take 340 ( 100 +80+80+80 ) page faults.

FIFO will take 400( 100 +100+100+100 ) page faults.

LRU will take 400( 100 +100+100+100 ) page faults.

MRU will take 340( 100 +80+80+80 ) page faults.

LIFO will take 343 ( 100+81*3 ) page faults

The answer is (D)
0 votes
0 votes

I don't Know how are they getting 300+ page fault even there are only 300 numbers  lets say if every page number gets one page fault then max would be 300...My answer is

Caption

OPTIMAL=260

LRU=FIFO=300

LIFO=262

MRU=260

 

Answer:

Related questions

24 votes
24 votes
4 answers
1
go_editor asked Sep 26, 2014
7,371 views
Assume that there are $3$ page frames which are initially empty. If the page reference string is $\text{1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6}$ the number of page faults using ...