Consider a demand paging system with four-page frames (initially empty) and LRU page replacement policy. For the following page reference string

7, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1

the page fault rate, defined as the ratio of number of page faults to the number of memory accesses (rounded off to one decimal place) is_________.

Correct Answer:

0.6

Solution:
String ReferenceFrame 1Frame 2 Frame 3Frame 4Hit/Miss
77   Miss
272  Miss
772  Hit
3723 Miss
2723 Hit
57235Miss
37235Hit
44235Miss
64635Miss
74637Miss
74637Hit
14617Miss
55617Miss
65617Hit
15617Hit

No. Of Page Faults  = 9

No. Of Memory Access = 15

The ratio of no. page faults to no. of memory access is 9/15 = 0.6