RPR

Click here to use the algorithm

In page replacement using a random algorithm (random) everytime a page fault occurs, the replaced page is randomly selected. This technique does not use any information to determining which pages to replace, all pages in main memory have the same weight to be selected. How to select random or arbitary pages, including the page that is currently referenced. This random technique is very bad, the experiment shows random algorithm causes a very high frequency of page faults.

For example

Consider page reference string 1, 3, 0, 3, 5, 6 and 3 page slots.

Initially all slots are empty, so when 1, 3, 0 came they are allocated to the empty slots —> 3 Page Faults.
when 3 comes, it is already in memory so —> 0 Page Faults.
Then 5 comes, it is not available in memory so it replaces the oldest page slot i.e 1. —>1 Page Fault.
Finally 6 comes, it is also not available in memory so it replaces the oldest page slot i.e 3 —>1 Page Fault.

So total page faults = 5.