Consider a demandpaging system in which a process is allocat
Consider a demand-paging system in which a process is allocated three memory frames. When a page fault occurs in the process, let p1, p2 and p3 be the three pages of the process that are resident in memory. Let the timestamps of arrival (i.e., the time at which the page was loaded most recently) for these three pages be a1, a2 and a3 respectively. Let the timestamps of last reference to these pages be r1, r2 and r3 respectively.
Let the Least Recently Used (LRU) page-replacement scheme be employed by the demand-paging system. If p2 is the page that is chosen to be replaced as part of servicing the page fault, determine the relationships among a1, a2, a3, r1, r2 and r3. Based on these relationships, select from the following list the statement that is CERTAIN to be TRUE.
q4;
| 4. | Consider a demand-paging system in which a process is allocated three memory frames. When a page fault occurs in the process, let p1, p2 and p3 be the three pages of the process that are resident in memory. Let the timestamps of arrival (i.e., the time at which the page was loaded most recently) for these three pages be a1, a2 and a3 respectively. Let the timestamps of last reference to these pages be r1, r2 and r3 respectively. Let the Least Recently Used (LRU) page-replacement scheme be employed by the demand-paging system. If p2 is the page that is chosen to be replaced as part of servicing the page fault, determine the relationships among a1, a2, a3, r1, r2 and r3. Based on these relationships, select from the following list the statement that is CERTAIN to be TRUE. | 
Solution
The correct Options are b and d
Reason: a is not valid since if a2 is later than r1 then it does not guarantee that p2 will be swapped out
c is also invalid as after p3 if p2 arrives then p3 needs to be swapped out.
Hence b is valid since a1 will get into ready queue after r2 and in the same way a3 will come after r2

