IAE Academy

GATE 2018 CS Q.10: solution and answer

GATE 2018 · CSQ.10 · 1 mark · MCQ

Consider a process executing on an operating system that uses demand paging. The average time for a memory access in the system is M units if the corresponding memory page is available in memory, and D units if the memory access causes a page fault. It has been experimentally measured that the average time taken for a memory access in the process is X units.

Which one of the following is the correct expression for the page fault rate experienced by the process?

  1. (A)

    (D - M) / (X - M)

  2. (B)

    (X - M) / (D - M)

  3. (C)

    (D - X) / (D - M)

  4. (D)

    (X - M) / (D - X)

See the question in the paper

Answer and solution

ANSWER

The page fault rate is , which is option (B).

Official answer: BSource: Official answer key, GATE 2018 CS (IIT Guwahati)

  1. Let be the page fault rate. A fraction of accesses find the page in memory and cost units; a fraction cause a page fault and cost units.

  2. The average access time is the weighted average:

  3. Expand: .

  4. Rearrange: .

  5. Solve for :

  6. This is option (B). Check: if then ; if then .

  7. The other options fail the same check. (A) is the reciprocal of (B), so it gives when but is undefined when . (C) gives at and at , the reverse of what is needed. (D) is undefined at .

KEY IDEA

The measured average access time is a weighted average of the hit time and the fault time , with weights and . Solve that linear equation for .

WATCH OUT FOR

Writing the weights the wrong way round, as . That gives , which is option (C), and it is the fraction of accesses that did not fault.

From the GATE 2018 CS paper. Every question of this paper · Download the full paper · All 6 Virtual memory questions, with notes

More Virtual memory questions