Question

In: Computer Science

Consider the following reference string: 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0,...

Consider the following reference string:

7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1

Find the number of Page Faults with FIFO, Optimal Page Replacement, and LRU with four free frames that are initially empty. Which algorithm gives the minimum number of page faults?

Solutions

Expert Solution

Solution

FIFO

7

3

3

3

3

2

2

0

0

4

4

4

4

7

1

1

1

0

0

0

0

2

2

2

2

1

1

1

   4               1                 1               1                1                1                1

Number of page fault is

   =4+1+1+1+1+1+1

=4+6

=10

---

Optimal

7

3

3

1

1

0

0

0

0

0

1

1

4

4

7

2

2

2

2

2

   4               1                 1               1                1               

Number of page fault is

   =4+1+1+1+1

=4+4

=8

---

LRU

7

3

3

3

7

0

0

0

0

0

1

1

4

1

1

2

2

2

2

2

   4               1                 1               1                1               

Number of page fault is

   =4+1+1+1+1

=4+4

=8

Total Number of Page replacements

FIFO-10

Optimal-8

LRU-8

Therefore Both Optimal and LRU gives the minimum number of page faults

---

all the best


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
The following page-reference string: 1, 2, 4, 3, 2, 5, 4, 2, 4, 2, 1, 3,...
The following page-reference string: 1, 2, 4, 3, 2, 5, 4, 2, 4, 2, 1, 3, 2, 3, 1, 3, 6, 1, 6, 4. Main memory with 3 frames of 1 kilobyte available and they are all initially empty. Complete a figure, similar to Figure 8.14(in the slides or textbook), showing the frame allocation for each of the following page replacement policies: a. Optimal b. Least recently used c. First-in-first-out Then, find the relative performance of each policy with respect...
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 string of page references: 5, 7, 8,9, 7, 3, 7, 4, 9, 3,...
Consider the following string of page references: 5, 7, 8,9, 7, 3, 7, 4, 9, 3, 7, 3, 9. showing the frame allocation for: a. Optimal b. LRU (least recently used) c. FIFO (first-in-first-out) d. List the total number of page faults for each policy. Count page faults only after all frames have been initialized.
Mother's age 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,51 Female 1, 0, 2, 2, 3, 4, 7, 3, 2, 4, 7, 1,...
Mother's age 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,51 Female 1, 0, 2, 2, 3, 4, 7, 3, 2, 4, 7, 1, 6, 4, 5, 3, 1, 4, 0, 1, 1, 1, 0, 1, 0 Use the stem and leaf plots that you previously created to help you draw and label histograms on your scratch paper with bin width of 2 for mothers's age at birth of female students and for mother's age at birth of male students. Make the lower bound of your first bin...
A = (1 −7 5 0 0 10 8 2 2 4 10 3 −4 8...
A = (1 −7 5 0 0 10 8 2 2 4 10 3 −4 8 −9 6) (1) Count the number of rows that contain negative components. (2) Obtain the inverse of A and count the number of columns that contain even number of positive components. (3) Assign column names (a,b,c,d) to the columns of A. (4) Transform the matrix A into a vector object a by stacking rows. (5) Replace the diagonal components of A with (0,0,2,3). Hint:...
DATA 3 8 2 15 2 2 0 0 4 5 2 7 0 1 5...
DATA 3 8 2 15 2 2 0 0 4 5 2 7 0 1 5 3 0 2 5 4 1 6 9 5 3 1 2 10 6 1 1 2 1 19 6 6 6 7 0 4 1 1 1 0 1 9 2 2 2 1 16 10 10 5 2 3 1 4 4 4 3 6 2 8 5 2 7 1 6 4 0 3 1 1 1 Background: A group of...
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.
A= 1 2 4 0 1 -2 -1 0 1 2 0 3 8 1 4...
A= 1 2 4 0 1 -2 -1 0 1 2 0 3 8 1 4 . Let W denote the row space for A. (a) Find an orthonormal basis for W and for W⊥. (b) Compute projW⊥(1 1 1 1 1 ).
exampleInput.txt 1 2 3 0 2 3 4 0 1 3 5 0 1 2 6...
exampleInput.txt 1 2 3 0 2 3 4 0 1 3 5 0 1 2 6 1 5 6 8 2 4 6 7 3 4 5 9 10 5 8 9 4 7 9 6 7 8 6 How can I detect when 'cin' starts reading from a new line. The amount of numbers in each row is unknown. I need them in type 'int' to use the data.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT