# GATE Papers >> CSE >> 2016 >> Question No 59

Question No. 59

Consider a computer system with ten physical page frames. The system is provided with an access sequence $\left(a_1,\;a_2,...,a_{20},\;a_1,\;a_2,...a_{20}\right),$ where each $a_i$ is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is __________.

##### Answer : 1.0 : 1.0

Solution of Question No 59 of GATE 2016 CSE Paper

This question is little tricks, but not difficult. You can solve the problem by taking smaller example with smaller values.

Example: 1, 2, 3, 4, 1, 2, 3, 4 with '2' frames.

LIFO: 1, 2, 3, 4, 1, 2, 3, 4

 2 3 4 4 2 3 3 1 1 1 1 1 1 1 1 F F F F F F F

Total page faults = 7

Optimal: 1, 2, 3, 4, 1, 2, 3, 4

 2 3 4 4 4 4 4 1 1 1 1 1 2 1 1 F F F F F F

Total page faults = 6

7 - 6 = 1.