edited by
15,262 views
46 votes
46 votes

Recall that Belady's anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:

  • $S_1$: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady's anomaly.
  • $S_2$: LRU page replacement algorithm suffers from Belady's anomaly.

Which of the following is CORRECT?

  1. $S_1$ is true, $S_2$ is true
  2. $S_1$ is true, $S_2$ is false
  3. $S_1$ is false, $S_2$ is true
  4. $S_1$ is false, $S_2$ is false
edited by

5 Answers

–2 votes
–2 votes

Belady's anomaly definition : Increasing the number of page frames may increase the number of page faults.

Thus we say FIFO suffers from Belady's anomaly. Stack based algo such as LRU and Optimal need not.

Random Page Replacement Algorithm : It may suffer from Belady's anomaly if it behaves as FIFO. For example, Let us consider a reference string in FIFO which leads to belady's anomaly. The same input is provided to Random Page Replacement algorithm and it decides to behave as LRU which will not lead to increase in page faults. Thus according to my thought process "may" word is important which is missing. Similar to the State halting problem of TOC. Will the machine reach state q on some input w?

Let page numbers be 1,2,3, 4 be equivalent to symbols in our Alphabet. Set of all string possible over an Alphabet will be nothing but our reference string for page access.

Let us design a Turing Machine FIFO which will produce two output 

- YES for all the strings which suffer from Belady's anomaly on increase in no of frames

- NO for all the strings which does not suffer from Belady's anomaly on increase in no of frames

The above two ans are possible since Set of all strings over an alphabet are countable.

Now Lets provide those strings as input to a Random Replacement Page Algorithm on which FIFO machine says YES and ask the question Will there be a string on which the machine will work as FIFO? Reducible to State visiting problem and hence Undecidable..

NOTE: The may word included in definition of Belady's anomaly is bounded with the phrase for some strings may increase. Just like the concept of first oder logic.

Option D) Should be correct.

edited by
Answer:

Related questions

24 votes
24 votes
3 answers
2
48 votes
48 votes
7 answers
3
Arjun asked Feb 14, 2017
17,104 views
Threads of a process shareglobal variables but not heapheap but not global variablesneither global variables nor heapboth heap and global variables