Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Given reference to the following page by a pr... Start Learning for Free
Given reference to the following page by a program:
0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3 
If the program contains 3 page frames.
How many page fault will occur in optimal page replacement policy?
  • a)
    4
  • b)
    5 .
  • c)
    6
  • d)
    7
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, ...
View all questions of this test
Most Upvoted Answer
Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, ...
Solution:

In optimal page replacement policy, we replace the page which will not be used for the longest period of time in the future. We can determine this by looking at the future references to pages.

Given reference to the following page by a program:
0, 9, 0, 1, 8, 1, 8, 7, 8, 7, 1, 2, 8, 2, 7, 8, 2, 3, 8, 3

If the program contains 3 page frames, we can simulate the reference string and count the number of page faults.

Initially, all the page frames are empty. We start reading the reference string from left to right.

1. The first page referenced is 0. We insert it into the first page frame. (Page Fault)
```
0
```

2. The next page referenced is 9. We insert it into the second page frame. (Page Fault)
```
0 9
```

3. The next page referenced is 0. It is already present in the first page frame. No page fault occurs.
```
0 9
```

4. The next page referenced is 1. We insert it into the third page frame. (Page Fault)
```
0 9 1
```

5. The next page referenced is 8. We insert it into the first page frame. (Page Fault)
```
8 9 1
```

6. The next page referenced is 1. It is already present in the third page frame. No page fault occurs.
```
8 9 1
```

7. The next page referenced is 8. It is already present in the first page frame. No page fault occurs.
```
8 9 1
```

8. The next page referenced is 7. We can replace the page 9 with 7 as it will not be used in the future. (Page Fault)
```
8 7 1
```

9. The next page referenced is 8. It is already present in the first page frame. No page fault occurs.
```
8 7 1
```

10. The next page referenced is 7. It is already present in the second page frame. No page fault occurs.
```
8 7 1
```

11. The next page referenced is 1. It is already present in the third page frame. No page fault occurs.
```
8 7 1
```

12. The next page referenced is 2. We can replace the page 8 with 2 as it will not be used in the future. (Page Fault)
```
2 7 1
```

13. The next page referenced is 8. We can replace the page 7 with 8 as it will not be used in the future. (Page Fault)
```
2 8 1
```

14. The next page referenced is 2. It is already present in the first page frame. No page fault occurs.
```
2 8 1
```

15. The next page referenced is 7. We can replace the page 1 with 7 as it will not be used in the future. (Page Fault)
```
2 8 7
```

16. The
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3If the program contains 3 page frames.How many page fault will occur in optimal page replacement policy?a)4b)5 .c)6d)7Correct answer is option 'D'. Can you explain this answer?
Question Description
Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3If the program contains 3 page frames.How many page fault will occur in optimal page replacement policy?a)4b)5 .c)6d)7Correct answer is option 'D'. 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 Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3If the program contains 3 page frames.How many page fault will occur in optimal page replacement policy?a)4b)5 .c)6d)7Correct answer is option 'D'. 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 Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3If the program contains 3 page frames.How many page fault will occur in optimal page replacement policy?a)4b)5 .c)6d)7Correct answer is option 'D'. Can you explain this answer?.
Solutions for Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3If the program contains 3 page frames.How many page fault will occur in optimal page replacement policy?a)4b)5 .c)6d)7Correct answer is option 'D'. 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 Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3If the program contains 3 page frames.How many page fault will occur in optimal page replacement policy?a)4b)5 .c)6d)7Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3If the program contains 3 page frames.How many page fault will occur in optimal page replacement policy?a)4b)5 .c)6d)7Correct answer is option 'D'. Can you explain this answer?, a detailed solution for Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3If the program contains 3 page frames.How many page fault will occur in optimal page replacement policy?a)4b)5 .c)6d)7Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3If the program contains 3 page frames.How many page fault will occur in optimal page replacement policy?a)4b)5 .c)6d)7Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Given reference to the following page by a program:0, 9, 0, 1,8, 1,8, 7, 8, 7, 1,2, 8, 2, 7, 8, 2, 3, 8, 3If the program contains 3 page frames.How many page fault will occur in optimal page replacement policy?a)4b)5 .c)6d)7Correct answer is option 'D'. 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