Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Assume that there are 3 page frames which are... Start Learning for Free
Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,
4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.
    Correct answer is '7'. Can you explain this answer?
    Verified Answer
    Assume that there are 3 page frames which are initially empty. If the ...
    In optimal page replacement replacement policy, we replace the place which is not used for longest duration in future.

    Given three page frames.

    Reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6

    Initially, there are three page faults and entries are
    1  2  3

    Page 4 causes a page fault and replaces 3 (3 is the longest
    distant in future), entries become
    1  2  4
    Total page faults =  3+1 = 4

    Pages 2 and 1 don't cause any fault.

    5 causes a page fault and replaces 1, entries become
    5  2  4
    Total page faults =  4 + 1 = 5

    3 causes a page fault and replaces 1, entries become
    3  2  4
    Total page faults =  5 + 1 = 6

    3, 2 and 4 don't cause any page fault.

    6 causes a page fault.
    Total page faults =  6 + 1 = 7
    View all questions of this test
    Most Upvoted Answer
    Assume that there are 3 page frames which are initially empty. If the ...
    Explanation:

    The optimal replacement policy is a theoretical algorithm that always selects the page that will not be used for the longest period of time in the future. However, it is practically impossible to implement this algorithm in real systems as it requires knowledge of future page references.

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

    We have 3 page frames initially empty, so the first 3 page references will result in page faults as there are no pages in the frames. The frames will be filled as follows:

    1. Page fault: 1 is not in the frames. Page 1 is loaded into the first frame.
    2. Page fault: 2 is not in the frames. Page 2 is loaded into the second frame.
    3. Page fault: 3 is not in the frames. Page 3 is loaded into the third frame.

    Now, the frames contain pages 1, 2, and 3. The next page reference is 4. As there is no page fault, the frames still contain pages 1, 2, and 3.

    The next page reference is 2. As page 2 is already in the frames, there is no page fault.

    The next page reference is 1. As page 1 is already in the frames, there is no page fault.

    The next page reference is 5. As page 5 is not in the frames, a page fault occurs. The optimal replacement policy would replace page 3 with page 5 as it will not be used for the longest period of time.

    The next page reference is 3. As page 3 is already in the frames, there is no page fault.

    The next page reference is 2. As page 2 is already in the frames, there is no page fault.

    The next page reference is 4. As page 4 is not in the frames, a page fault occurs. The optimal replacement policy would replace page 1 with page 4 as it will not be used for the longest period of time.

    The next page reference is 6. As page 6 is not in the frames, a page fault occurs. The optimal replacement policy would replace page 2 with page 6 as it will not be used for the longest period of time.

    Therefore, the total number of page faults using the optimal replacement policy is 7.
    Explore Courses for Computer Science Engineering (CSE) exam

    Similar Computer Science Engineering (CSE) Doubts

    Top Courses for Computer Science Engineering (CSE)

    Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer is '7'. Can you explain this answer?
    Question Description
    Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer is '7'. 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 Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer is '7'. 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 Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer is '7'. Can you explain this answer?.
    Solutions for Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer is '7'. 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 Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer is '7'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer is '7'. Can you explain this answer?, a detailed solution for Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer is '7'. Can you explain this answer? has been provided alongside types of Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer is '7'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3,4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.Correct answer is '7'. 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