Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider the data given in above question. Le... Start Learning for Free
Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?
  • a)
    0
  • b)
    1
  • c)
    2
  • d)
    3
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
Consider the data given in above question. Least Recently Used (LRU) p...
LRU replacement policy: The page that is least recently used is being Replaced. Given String:   1, 2, 1, 3, 7, 4, 5, 6, 3, 1 123  // 1 ,2, 3 //page faults 173 ->7 473 ->4 453 ->5 456 ->6 356 ->3 316 ->1 Total 9, In optimal Replacement total page faults=7 Therefore 2 more page faults  Answer is C
View all questions of this test
Most Upvoted Answer
Consider the data given in above question. Least Recently Used (LRU) p...
To determine the number of additional page faults that occur with the Least Recently Used (LRU) page replacement policy compared to the optimal page replacement policy, we need to analyze the given reference string and simulate both policies.

Given reference string: 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6

Optimal page replacement policy:
The optimal page replacement policy replaces the page that will not be used for the longest period of time in the future. Since we don't have future information in this question, we can only make assumptions based on the given reference string.

LRU page replacement policy:
The LRU page replacement policy replaces the page that has not been used for the longest period of time. It maintains a queue of the most recently used pages and replaces the page at the front of the queue.

To simulate both policies, we will use a frame size of 3 (as mentioned in the previous question).

Simulation:

1. Optimal page replacement policy:
- Initially, the frames are empty. So, page fault occurs for 1.
- Page 2 is referenced next. So, page fault occurs for 2.
- Page 3 is referenced next. So, page fault occurs for 3.
- Page 4 is referenced next. So, page fault occurs for 4.
- Page 2 is referenced again. No page fault occurs.
- Page 1 is referenced next. So, page fault occurs for 1.
- Page 5 is referenced next. So, page fault occurs for 5.
- Page 6 is referenced next. So, page fault occurs for 6.
- Page 2 is referenced again. No page fault occurs.
- Page 1 is referenced again. No page fault occurs.
- Page 2 is referenced again. No page fault occurs.
- Page 3 is referenced next. So, page fault occurs for 3.
- Page 7 is referenced next. So, page fault occurs for 7.
- Page 6 is referenced again. No page fault occurs.
- Page 3 is referenced again. No page fault occurs.
- Page 2 is referenced again. No page fault occurs.
- Page 1 is referenced again. No page fault occurs.
- Page 2 is referenced again. No page fault occurs.
- Page 3 is referenced again. No page fault occurs.
- Page 6 is referenced again. No page fault occurs.

Total page faults with optimal page replacement policy = 9

2. LRU page replacement policy:
- Initially, the frames are empty. So, page fault occurs for 1.
- Page 2 is referenced next. So, page fault occurs for 2.
- Page 3 is referenced next. So, page fault occurs for 3.
- Page 4 is referenced next. So, page fault occurs for 4.
- Page 2 is referenced again. No page fault occurs.
- Page 1 is referenced next. So, page fault occurs for 1.
- Page 5 is referenced next. So, page fault occurs for 5.
- Page 6 is referenced next. So, page fault occurs for 6.
- Page
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?a)0b)1c)2d)3Correct answer is option 'C'. Can you explain this answer?
Question Description
Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?a)0b)1c)2d)3Correct answer is option 'C'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?a)0b)1c)2d)3Correct answer is option 'C'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?a)0b)1c)2d)3Correct answer is option 'C'. Can you explain this answer?.
Solutions for Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?a)0b)1c)2d)3Correct answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?a)0b)1c)2d)3Correct answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?a)0b)1c)2d)3Correct answer is option 'C'. Can you explain this answer?, a detailed solution for Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?a)0b)1c)2d)3Correct answer is option 'C'. Can you explain this answer? has been provided alongside types of Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?a)0b)1c)2d)3Correct answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the data given in above question. Least Recently Used (LRU) page replacement policy is a practical approximation to optimal page replacement. For the above reference string, how many more page faults occur with LRU than with the optimal page replacement policy?a)0b)1c)2d)3Correct answer is option 'C'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev