GATE CS 2012 · Question 46 · Theory of Computation · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

Consider the set of strings on {0,1} in which, every substring of 3 symbols has at most two zeros. For example, 001110 and 011001 are in the language, but 100010 is not. All strings of length less than 3 are also in the language. A partially completed DFA that accepts this language is shown below.
The missing arcs in the DFA are

Partially completed DFA. States: ε (start state, marked by an incoming arrow, accepting/double circle), 0, 1, 00, 01, 10, 11 (all accepting, double circles), and q (non-accepting, single circle). Transitions shown: ε --0--> 0; ε --1--> 1; 0 --0--> 00; 0 --1--> 01; 1 --0--> 10; 1 --1--> 11; 01 --0--> 10; 10 --1--> 01; 11 --1--> 11 (self-loop); q --0,1--> q (self-loop). No outgoing transitions are drawn from state 00, there is no transition on 1 from 01, no transition on 0 from 10 and no transition on 0 from 11.
  1. (A) 00 | 01 | 10 | 11 | q; 00 | 1 | 0; 01 | 1; 10 | 0; 11 | 0
    00011011q
    0010
    011
    100
    110
  2. (B) 00 | 01 | 10 | 11 | q; 00 | 0 | 1; 01 | 1; 10 | 0; 11 | 0
    00011011q
    0001
    011
    100
    110
  3. (C) 00 | 01 | 10 | 11 | q; 00 | 1 | 0; 01 | 1; 10 | 0; 11 | 0
    00011011q
    0010
    011
    100
    110
  4. (D) 00 | 01 | 10 | 11 | q; 00 | 1 | 0; 01 | 1; 10 | 0; 11 | 0
    00011011q
    0010
    011
    100
    110
Answer

Answer (D)

Answer from the official GATE CS 2012 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes