Question

In: Computer Science

Page Replacement Algorithms. Consider the following page reference stream and 3 page frames: 0 1 2...

Page Replacement Algorithms. Consider the following page reference stream and 3 page frames: 0 1 2 3 2 4 3 1 1 5 2 4 6 3 3 4 6 3 4 7.
For the MIN, FIFO, and LRU algorithms, show the contents of the page frame after each reference, and then compute the total number of page faults, divided in to cold misses and other misses.

Solutions

Expert Solution

min algorithm or optimal page replacement ;-

y-> yes

n-> no

total page fault ->9

string 0 1 2 3 2 4 3 1 1 5 2 4 6 3 3 4 6 3 4 7
frame 1 0 0 0 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 7
frame 2 1 1 1 1 1 1 1 1 5 2 2 6 6 6 6 6 6 6 6
frame 3 2 2 2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
page fault ? y y y y n y n n n y y n y n n n n n n y

fifo

total page fault -> 12

string 0 1 2 3 2 4 3 1 1 5 2 4 6 3 3 4 6 3 4 7
frame 1 0 0 0 3 3 3 3 3 3 5 5 5 6 6 6 6 6 6 6 6
frame 2 1 1 1 1 4 4 4 4 4 2 2 2 3 3 3 3 3 3 3
frame 3 2 2 2 2 2 1 1 1 1 4 4 4 4 4 4 4 4 7
page fault ? y y y y n y n y n y y y y y n n n n n y

c) lru algorithm

total page fault 12

string 0 1 2 3 2 4 3 1 1 5 2 4 6 3 3 4 6 3 4 7
frame 1 0 0 0 3 3 3 3 3 3 3 2 2 2 3 3 3 3 3 3 3
frame 2 1 1 1 1 4 4 4 4 5 5 5 6 6 6 6 6 6 6 7
frame 3 2 2 2 2 2 1 1 1 1 4 4 4 4 4 4 4 4 4
page fault ? y y y y n y n y n y y y y y n n n n n y

Related Solutions

Consider the following page reference string: 0, 1, 2, 3, 1, 0, 4, 5, 1, 0,...
Consider the following page reference string: 0, 1, 2, 3, 1, 0, 4, 5, 1, 0, 1, 2, 6, 5, 2, 1, 0, 1, 2, 5 How many page faults would occur for the following replacement algorithms, assuming one, three, five, and seven frames? Remember that all frames are initially empty, so your first unique pages will cost one fault each. Optimal replacement LRU replacement CLOCK replacement FIFO replacement
Find LRU paging A program has the following page reference string 0 1 2 3 3...
Find LRU paging A program has the following page reference string 0 1 2 3 3 4 2 4 5 3 3 4 6 2 5 6 If we allocate 3 page frames to the program, 1. Please draw a figure to show the page allocation/replacement. 2. How many page faults will be generated?
Consider the following uneven cash flow stream 0 0 1 $250 2 $400 3 $500 4...
Consider the following uneven cash flow stream 0 0 1 $250 2 $400 3 $500 4 $600 5 $600 What is the present (Year 0) value if the opportunity cost (discount) rate is 10%? Add an outflow (or cost) of $1,000 at Year 0. What is the present value of the cash flow stream? Your oldest daughter is about to start kindergarten at a private school. Tuition is $10,000 per year payable at the beginning of the school year. You...
reference string 0123342453346256 If we allocate 3 page frames to the program, 1. Please draw a...
reference string 0123342453346256 If we allocate 3 page frames to the program, 1. Please draw a figure to show the LRU page allocation/replacement \. 2. How many page faults will be generated?
Consider the following function: (?) = ?(?3 + 1), ? = 0, 1, 2, 3 What...
Consider the following function: (?) = ?(?3 + 1), ? = 0, 1, 2, 3 What is the value of the constant ? so that (?) is a pmf? Plug-in the value of ? in the expression of (?) and show the pmf in a table. Draw a probability histogram of the pmf. Find the cdf (?) and write it explicitly defined over the entire real number line. Draw the cdf (?). Calculate the probabilities: (i). (0 < ? ≤...
Write a 1-2-page paper (not including title page and reference page) that describes the following: Ø...
Write a 1-2-page paper (not including title page and reference page) that describes the following: Ø You are caring for a patient with c-diff as part of your workload assignment. Discuss what c-diff is and how it is transmitted (how you can get it)? Ø What actions will you take as a nurse to protect yourself and the other patients on the unit when taking care of your patient? You should include a minimum of 3 scholarly references (suggestion on...
Write a 1-2-page paper (not including title page and reference page) that describes the following: Ø...
Write a 1-2-page paper (not including title page and reference page) that describes the following: Ø You are caring for a patient with c-diff as part of your workload assignment. Discuss what c-diff is and how it is transmitted (how you can get it)? Ø What actions will you take as a nurse to protect yourself and the other patients on the unit when taking care of your patient? You should include a minimum of 3 scholarly references (suggestion on...
Write a program that implements the FIFO, LRU, and Optimal page replacement algorithms presented in chapter...
Write a program that implements the FIFO, LRU, and Optimal page replacement algorithms presented in chapter 8 of your text. First generate a random page-reference string (this should be 20 entries long) where page numbers range from 0 to 9. Apply the random page-reference string to each algorithm, and record the number of page faults incurred by each algorithm. Implement the replacement algorithms so that the number of page frames goes from 1 to 7 and you must compute the...
Consider the following Markov chain: 0 1 2 3 0 0.3 0.5 0 0.2 1 0.5...
Consider the following Markov chain: 0 1 2 3 0 0.3 0.5 0 0.2 1 0.5 0.2 0.2 0.1 2 0.2 0.3 0.4 0.1 3 0.1 0.2 0.4 0.3 What is the probability that the first passage time from 2 to 1 is 3? What is the expected first passage time from 2 to 1? What is the expected first passage time from 2 to 2 (recurrence time for 2)? What is the relation between this expectation and the steady-state...
Consider the matrix A given by [ 2 0 0 ] [ 0 2 3 ]...
Consider the matrix A given by [ 2 0 0 ] [ 0 2 3 ] [ 0 3 10 ] (20) Find all its eigenvalues and corresponding eigenvectors. Show your work. (+5) Write down the entire eigendecomposition (i.e. the matrices X, Lambda, and X inverse) explicitly.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT