Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  A process, has been allocated 3 page frames. ... Start Learning for Free
A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1

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
A process, has been allocated 3 page frames. Assume that none of the 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
A process, has been allocated 3 page frames. Assume that none of the p...
To understand why LRU page replacement policy results in 2 more page faults than the optimal page replacement policy for the given reference string, let's analyze the sequence of page references and the behavior of both policies.

The given reference string is: 1, 2, 1, 3, 7, 4, 5, 6, 3, 1

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 cannot predict the future, we can only determine the optimal replacement policy in hindsight.

LRU Page Replacement Policy:
The LRU page replacement policy replaces the page that has not been used for the longest period of time. It assumes that the pages that have been used recently are likely to be used again in the near future.

Step-by-step analysis:
Let's analyze the reference string and the behavior of both policies step by step:

1. The first page reference is 1.
- Both policies will result in a page fault as there are no pages in memory initially.
- Both policies will allocate the page frame to page 1.

2. The second page reference is 2.
- Both policies will result in a page fault as page 2 is not in memory.
- Both policies will allocate the second page frame to page 2.

3. The third page reference is 1.
- Both policies will consider page 1 as the least recently used page as it was referenced before page 2.
- Both policies will allocate the third page frame to page 1.

4. The fourth page reference is 3.
- Both policies will result in a page fault as page 3 is not in memory.
- Both policies will replace page 2, as it was referenced before page 3.

5. The fifth page reference is 7.
- Both policies will result in a page fault as page 7 is not in memory.
- Both policies will replace page 1, as it was least recently used.

6. The sixth page reference is 4.
- Both policies will result in a page fault as page 4 is not in memory.
- Both policies will replace page 3, as it was least recently used.

7. The seventh page reference is 5.
- Both policies will result in a page fault as page 5 is not in memory.
- Both policies will replace page 7, as it was least recently used.

8. The eighth page reference is 6.
- Both policies will result in a page fault as page 6 is not in memory.
- Both policies will replace page 4, as it was least recently used.

9. The ninth page reference is 3.
- The optimal page replacement policy will replace page 5, as it is not used in the future.
- The LRU page replacement policy will replace page 5, as it was least recently used.

10. The tenth page reference is 1.
- The optimal page replacement policy will not replace any page, as all the pages in memory are used in the future.
- The LRU page replacement policy will replace page 6, as it was least recently used.

Comparing the two policies:
From the above analysis, we can observe that the LRU page replacement policy results in 2 more page faults than
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1Least 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
A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1Least 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 A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1Least 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 A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1Least 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 A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1Least 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 A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1Least 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 A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1Least 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 A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1Least 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 A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1Least 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 A process, has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1,2,1,3,7,4,5,6,3,1Least 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