GATE 2005
203 questions
MCQ 2031-mark 203
Questions 126–130 of 203
Answer: (B)
Correct Option: B
The set is infinite, since the expression has in it. Every string in the set is finite. A string is defined as a FINITE sequence of characters, so it can never be infinite.
State X is the starting state of the automaton. Let the language accepted by the NFA with Y as the only accepting state be L1. Similarly, let the language accepted by the NFA with Z as the only accepting state be L2. Which of the following statements about L1 and L2 is TRUE?
Answer: (A)
(from X on 0, from Y on 0 by its self-loop, from Z on 1)
(from X on 0, from Y on 0, from Z on 1 by its self-loop)
The right-hand sides are the same, so . In words: after any input, the NFA can be in Y exactly when it can be in Z, because the same moves lead into both.
So the language accepted with Y as the only accepting state equals the one with Z as the only accepting state, . Neither contains the empty string, since X is not accepting. Proper inclusion in either direction is false.
Answer: (A)
Which one of the following is TRUE?
Answer: (B)
The machine reads the input from the LSB. In the first state it copies each as . On the first it outputs and moves to the second state. In the second state it complements every bit (, ) and stays there.
So the output keeps all bits up to and including the first from the LSB, and complements all bits after it. This is the rule for 2's complement.
. Check: 1's complement of is , and .
. Check: 1's complement of is , and .
. Check: 1's complement of is , and .
The other options fail on : the output is not its 1's complement , not the increment and not the decrement .
Note: the paper's figure labels both states . They are two different states: the first copies bits, the second complements them.
Answer: (B)
Answer: (D)
Correct Option: D
NFA and DFA have the same power, because every NFA can be converted into an equivalent DFA. But an NPDA can accept more languages than a DPDA.
The language recognized by M is :
Answer: (B)
So M accepts : at least one a, and every a is followed by at least two b's.
(A) is wrong: abbb is accepted, but its a is followed by three b's, not exactly two.
(C) is wrong: abba contains abb, but M rejects it (it ends in a non-final state).
(D) is wrong: ab has no aa, but M rejects it.
(B) describes the same strings. The only difference is that strings with no a (, b, bb, ...) satisfy (B) trivially, while M rejects them because its start state is not final. It is the closest option.
Answer: (B)