GATE 2006
191 questions
MCQ 1911-mark 191
Questions 121–125 of 191
Answer: (A)
State table from the diagram:
Reading from the table above:
Correct Answer:
Consider the strings . Which of the following statements is true?
Answer: (D)
Call the unlabelled bottom state . The transitions are: from , and ; from , and ; from , and . A string is accepted if it ends in .
, so u is accepted.
, so v is rejected.
, so w is rejected.
So the automaton accepts u but rejects v and w.
Answer: (D)
Answer: (D)
Strings of are made of blocks of 3 and 5 ones, so the lengths in L are . The lengths not in L are only .
Lengths 8, 9 and 10 are in L, and adding a block of keeps a length in L, so every length from 8 onward is in L. The DFA counts the length up to 8 and then stays in state 8:
Final states are 0, 3, 5, 6, 8 (5 states) and non-final states are 1, 2, 4, 7 (4 states). The total is 9.
Fewer states are not possible. From state (for ), the longest suffix that is rejected has , since length 7 is the largest length outside L. These values differ for different , so states 0 to 7 are pairwise distinguishable. State 8 rejects no suffix, so it differs from all of them. So the minimum is 9 states.
Answer: (D)
The Myhill-Nerode equivalence classes for the language generated by the grammar are
Answer: (A)
The grammar gives this DFA (S is the start and final state):
b does not change the state, and a switches between S and A. So S is reached by strings with an even number of a's, A by strings with an odd number of a's, and the language is . The DFA is minimal, because S is final and A is not, so the empty suffix separates them. So there are exactly two classes: even number of a's and odd number of a's.
Why the others fail:
- (B) The string "b" has an even number of a's and an odd number of b's, so it is in both sets. Classes cannot overlap.
- (C) The empty string and "ab" both have equal numbers of a and b, but adding "a" gives "a" (not in the language) and "aba" (in the language).
- (D) The empty string and "bb" are in the same class (both have zero a's), but (D) separates them.
Answer: (A)
I.
II.
III.
IV.
(The linked part asks which of these constructions could lead to a non-regular language; only I can.)
Which choice of L is best suited to support your answer above?
Answer: (A)
Option (A): is regular, and . This is not regular. Pumping lemma: take , which is in the language with . Pumping inside the first gives with . It has exactly two b's, so a split into needs one b in each half. But the first half is shorter than and so has no b. Hence the string is not of the form .
Why the others fail:
(B) is finite, so is finite and regular.
(C) , which is regular.
(D) is itself not regular, but the question needs a regular .
Answer: (A)