GATE 2011
81 questions
MCQ 811-mark 40 · 2-mark 41
Questions 36–40 of 81
A deterministic finite automation (DFA)D with alphabet = {a,b} is given below
Which of the following finite state machines is a valid minimal DFA which accepts the same language as D?
Which of the following finite state machines is a valid minimal DFA which accepts the same language as D?
Answer: (A)
In D, the states s and t are both accepting and both loop on a and b, so they are equivalent. Merge them into one state. State r is a dead state.
The merged machine has these moves: p -a s, p -b q, q -a s, q -b r. This is the machine in figure A. It accepts .
It is minimal, because its 4 states are pairwise distinguishable. State s accepts the empty string and the others do not. State r accepts nothing, but q accepts "a". The string "ba" is accepted from p but rejected from q.
The other figures are wrong. In (B) and (C), p goes to the accepting state q on a single b, so they accept "b", but D rejects "b" (b leads to q, which is not accepting). The machine in (D) has a b loop on q, so it accepts "bba", which D rejects.
Answer: (A)
The merged machine has these moves: p -a s, p -b q, q -a s, q -b r. This is the machine in figure A. It accepts .
It is minimal, because its 4 states are pairwise distinguishable. State s accepts the empty string and the others do not. State r accepts nothing, but q accepts "a". The string "ba" is accepted from p but rejected from q.
The other figures are wrong. In (B) and (C), p goes to the accepting state q on a single b, so they accept "b", but D rejects "b" (b leads to q, which is not accepting). The machine in (D) has a b loop on q, so it accepts "bba", which D rejects.
Answer: (A)
Definition of a language L with alphabet {a} is given as following L={ |k > 0, and n is a positive integer constant}
What is the minimum number of states needed in a DFA to recognize L?
What is the minimum number of states needed in a DFA to recognize L?
Answer: (B)
, so each string has a length that is a positive multiple of n.
Take states . State means i a's have been read, counting from the last return. The moves are on a, and goes back to on a. The accepting state is . The empty string is not accepted, so has to stay separate from .
All states are distinguishable. For , the string takes to (accepted), but takes to a state before (rejected). So no state can be merged and the minimum is n + 1.
Answer: (B)
Take states . State means i a's have been read, counting from the last return. The moves are on a, and goes back to on a. The accepting state is . The empty string is not accepted, so has to stay separate from .
All states are distinguishable. For , the string takes to (accepted), but takes to a state before (rejected). So no state can be merged and the minimum is n + 1.
Answer: (B)
Which of the following pairs have DIFFERENT expressive power?
Answer: (B)
Let us check each pair:
- DFA and NFA have the same power (subset construction).
- A deterministic TM and a non-deterministic TM have the same power. A single-tape TM and a multi-tape TM also have the same power.
- A DPDA accepts only deterministic CFLs. An NPDA accepts all CFLs (for example, needs non-determinism).
Answer: DPDA and NPDA
- DFA and NFA have the same power (subset construction).
- A deterministic TM and a non-deterministic TM have the same power. A single-tape TM and a multi-tape TM also have the same power.
- A DPDA accepts only deterministic CFLs. An NPDA accepts all CFLs (for example, needs non-determinism).
Answer: DPDA and NPDA
Let P be a regular language and Q be a context free language such that Q
P. (For example, let P be the language represented by the regular expression p*q* and Q be Then which of the following is ALWAYS regular?
Answer: (C)
is regular, and regular languages are closed under complement, so is always regular.
The other three can fail. Take and , so .
(A) , which is not regular.
(B) . If it were regular, then would be regular, which is false.
(D) If were regular, its complement would be regular, which is false.
Answer: (C)
The other three can fail. Take and , so .
(A) , which is not regular.
(B) . If it were regular, then would be regular, which is false.
(D) If were regular, its complement would be regular, which is false.
Answer: (C)
Consider the languages L1, L2 and L3 as given below
and
Which of the following statements is NOT TRUE?
and
Which of the following statements is NOT TRUE?
Answer: (C)
Let us check each statement:
- L1 = 0*1* it is regular
- L2 = it is a CFL
- L3 = it needs two comparisons it is not a CFL (but a TM can recognise it)
So the statement "all three languages are context free" is NOT true.
Answer: All the three languages are context free
- L1 = 0*1* it is regular
- L2 = it is a CFL
- L3 = it needs two comparisons it is not a CFL (but a TM can recognise it)
So the statement "all three languages are context free" is NOT true.
Answer: All the three languages are context free