## Page Replacement Algorithm Formulae and Terms

Edit

* Page Fault = if page is not present in frame

* Page Hit  = If page is present in frame.

1) FIFO = In First in first out algorithm we have to replace page which come first in page frame.

2) LRU =  In LRU we have to replace page which was not used for long time ( Reverse checking )

### LRU

Edit

Q.1  Consider the following page reference string. 8,1,3,1,8,6,4,3,8,4,8,7,1,2. The number of page frames = 3 , calculate the page faults and the hit ratio for least recently used

algorithm. ( Dec 2017   8 Marks )

Q      Consider the following page reference starting : 1,2,3,4,2,1,5,6,1,2,3,7,6,3,2,1,3,6. The number of page frames = 3. Calculate the page faults and the hit rati0 for least recently used  ( may – 2015 )  6 marks

### FIFO

Edit

Q      Consider the following page reference string : 7,1,2,1,2,5,4,5,9,4,9,8,1,3. The number of page frames = 3, calculate the page faults and the hit ratio for first in first out page replacement algorithm.    ( May 2017 ) Marks 5

Q      Consider the following page reference string: 9,1,3,1,3,6,4,6,8,4,8,7,1,2. The number of page frames size = 4 , calculate the page faults and the hit ratio for first In first out page replacement algorithm  ( May – 2016 )              6 Marks.

### Optimal Page Replacement

Edit

Q      Consider the following page reference string : 1,2,3,4,2,1,5,6,2,1,2,1,5,6 ( Frame Size = 3 ).

How many page faults would occur for the following replacement algorithms, Optimal page replacement.

For second last page to put 5 in page frame we will initially check forward page which will be 6. Now after that next page is not available , so we will chek backward pages. So we will get page 1 first. Now we have to  replace pages with page 2.

## References

Edit
• WikiNote Foundation

Last modified: Friday, 20 September 2019, 10:48 AM