GATE Computer ScienceHardGATE CS (PYQ pattern)
Let L be the set of binary strings of length at least 3 whose third symbol from the right end is 1. What is the number of states in the minimal DFA for L?
- A. 4
- B. 6
- C. 8
- D. 16
Correct answer: C. 8
A DFA must remember the last three symbols, and any two different 3-bit suffixes are distinguishable by a suitable continuation (the third-from-last bit after two more symbols is the first of them). Hence 2^3 = 8 states are necessary and sufficient; the NFA has only 4 states.
More Theory of Computation questions
- Consider I. {aⁿbᵐcⁿdᵐ | n, m ≥ 1}, II. {aⁿbᵐcᵐdⁿ | n, m ≥ 1}, III. {wwᴿ | w ∈ {a,b}}, IV. {ww | w ∈ {a,b}}. Which of these languages are…
- Which regular expression over {0,1} denotes exactly the set of strings that do not contain two consecutive 1s?
- Which of the following problems are decidable? I. Is L(G) empty for a given CFG G? II. Is L(G1) ∩ L(G2) empty for given CFGs G1 and G2?…
- Let L = { w ∈ {a, b} : (number of a's − number of b's) is divisible by 4 }. How many states does the minimal DFA for L have?
- A grammar G in Chomsky Normal Form (no ε-production) generates a string w of length 9. How many derivation steps does any derivation of w…
- Let L = { w ∈ {a, b} : w contains at most 3 a's and at least 2 b's }. How many states does the minimal complete DFA for L have?