GATE 2018
65 questions
MCQ 41 · NAT 241-mark 30 · 2-mark 35
Questions 16–20 of 65
Let N be an NFA with n states. Let k be the number of states of a minimal DFA which is equivalent to N. Which one of the following is necessarily true?
Answer: (D)
Use the subset construction to change an n-state NFA into a DFA. Each DFA state is a subset of the NFA's states, so there are at most of them. Minimizing never adds states, so always holds.
The other options can fail:
- (A) and (B) fail when the minimal DFA is much smaller. For example, an n-state NFA that accepts all strings has a 1-state minimal DFA.
- (C) fails for NFAs that really need the subsets. The language "the (n-1)th symbol from the end is 1" has an n-state NFA, but its minimal DFA needs states, which is more than for .
Answer: (D)
The other options can fail:
- (A) and (B) fail when the minimal DFA is much smaller. For example, an n-state NFA that accepts all strings has a 1-state minimal DFA.
- (C) fails for NFAs that really need the subsets. The language "the (n-1)th symbol from the end is 1" has an n-state NFA, but its minimal DFA needs states, which is more than for .
Answer: (D)
The set of all recursively enumerable languages is
Answer: (B)
RE languages are closed under intersection. To see this, run both TMs and accept only when both of them accept. RE languages are not closed under complement. They are a superset of the recursive languages, not a subset. They are also countable, because all TMs can be listed.
Answer: closed under intersection
Answer: closed under intersection
Which one of the following statements is FALSE?
Answer: (B)
Type checking belongs to semantic analysis. This phase runs after parsing, because it works on the syntax tree. So the statement "type checking is done before parsing" is false. The other statements are true.
Answer: Type checking is done before parsing
Answer: Type checking is done before parsing
The following are some events that occur after a device controller issues an interrupt while process L is under execution.
(P) The processor pushes the process status of L onto the control stack.
(Q) The processor finishes the execution of the current instruction.
(R) The processor executes the interrupt service routine.
(S) The processor pops the process status of L from the control stack.
(T) The processor loads the new PC value based on the interrupt.
Which one of the following is the correct order in which the events above occur?
(P) The processor pushes the process status of L onto the control stack.
(Q) The processor finishes the execution of the current instruction.
(R) The processor executes the interrupt service routine.
(S) The processor pops the process status of L from the control stack.
(T) The processor loads the new PC value based on the interrupt.
Which one of the following is the correct order in which the events above occur?
Answer: (A)
Steps of interrupt handling, in order:
Q: the current instruction is completed P: L's status is saved on the stack T: the PC is loaded with the ISR address R: the ISR is run S: L's status is restored.
Answer: QPTRS
Q: the current instruction is completed P: L's status is saved on the stack T: the PC is loaded with the ISR address R: the ISR is run S: L's status is restored.
Answer: QPTRS
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?
Which one of the following is the correct expression for the page fault rate experienced by the process?
Answer: (B)
Let p be the page fault rate. Average access time: .
Page fault rate:
Answer: (X - M) / (D - M)
Page fault rate:
Answer: (X - M) / (D - M)