Question
In the Least Recently Used (LRU) page replacement
algorithm, given the following reference string 4, 2, 4, 1, 5, 2, 3, 4, and assuming 3 frames, how many page faults will occur?Solution
LRU page replacement works by replacing the page that has not been used for the longest time. For the reference string 4, 2, 4, 1, 5, 2, 3, 4 with 3 frames, the page faults occur as follows: • Insert 4 (fault), Insert 2 (fault), Access 4 (hit), Insert 1 (fault), Insert 5 (fault, replace 4), Access 2 (hit), Insert 3 (fault, replace 1), Access 4 (fault, replace 5). Thus, there are 6 page faults in total. LRU minimizes page faults compared to other algorithms by always keeping the most recently used pages in memory. Why other options are wrong: A) 3 faults would require the reference string to contain repeated pages with no replacements. B) 5 faults underestimate the replacements required after the first few frames fill up. D) 7 faults occur in algorithms with more aggressive replacements like FIFO. E) 8 faults assume no page hits at all, which is incorrect since some pages are reused before replacement.
The ratio of the times taken by Aman, Bharat, and Charan to complete a task is 3:5:7 respectively. Dev takes 4 minutes more than Aman. If the difference...
A plot has to be divided among P, Q and R in the ratio 3:5:8 respectively. If the area of plot received by R is 4500m² more than the area of plot recei...
- If the mean proportion of 2.25 and 4 is 'k', then find the value of '3k'.
An amount is distributed among A, B, C, and D in the ratio 7:5:9:4 respectively. If the amount received by B is Rs. 1,250, then find the amount received...
Find the fourth proportion of (2k + 1), (4k + 2) and (6k + 3). (Note: 'k' is the smallest two-digit prime number.)
What is the mean proportion between 12 and 27?
Ratio of monthly income to monthly expenditure of A is 15:7, respectively and monthly savings of A is Rs. 2880. Find the monthly income of A.
The ratio of the number of girls to the number of boys in a school of 720 students is 3 : 5. If 18 boys left the school, find how many new girls ...
An amount is distributed among X, Y, Z, and W in the ratio 8:5:3:7 respectively. If the amount received by Y is Rs. 1,250 , then find the amount receiv...
70 percent of first number is equal to 50 percent of the second number. What is the respective ratio of the first number to the second number?