GATE Computer ScienceModerateGATE CSE · ISRO
Binary numerals are read most significant bit first (leading zeros allowed, the empty string counts as 0). What is the number of states in the minimal DFA accepting exactly the multiples of 6?
- A. 3
- B. 4
- C. 5
- D. 6
Correct answer: B. 4
Remainders r and r + 3 (mod 6) have identical transitions (2r + c is unchanged), and only remainder 0 accepts, so the classes are {0}, {3}, {1,4}, {2,5}: 4 states, not 6.
More Theory of Computation questions
- An NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting state 3. Transitions: δ(0,a) = {0,1}, δ(0,b) = {0}, δ(1,a) = δ(1,b)…
- How many strings of length 7 over {a, b} belong to the language of the regular expression (a + bb)(b + ε)?
- The grammar S → aSb | SS | ab generates how many distinct strings of length 6?
- Which of the following problems is decidable for the given input? I. Is the language of a given context-free grammar empty? II. Are two…
- Which of the following languages over {a, b} is context-free but not regular?
- A grammar in Chomsky normal form (no ε-productions) is used to derive a string of length 9. How many derivation steps (production…