GATE Computer ScienceVery hardGATE CS (PYQ pattern)
An ε-NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting set {0,3}. Transitions: δ(0): a→{1,2}, b→{3}, ε→∅; δ(1): a→{2}, b→{0,1}, ε→{2}; δ(2): a→{1}, b→{0}, ε→∅; δ(3): a→∅, b→{0,3}, ε→{2}. How many of the 32 strings of length 5 over {a, b} does it accept?
- A. 20
- B. 13
- C. 16
- D. 12
Correct answer: C. 16
Convert to a DFA (subset construction with ε-closure) and run all 32 strings of length 5: 16 end in an accepting subset. Counting accepting paths instead of strings would overcount.
More Theory of Computation questions
- How many states does the minimal complete DFA have for the set of strings over {a, b} that begin with ab OR end with ab?
- How many states does the minimal complete DFA for the set of strings over {a, b} that end with abb have?
- Let L = { w ∈ {a, b} : na(w) is divisible by 3 }. How many states does the minimal complete DFA for the concatenation L·L have?
- How many states does the minimal complete DFA have for { w ∈ {a, b} : w contains exactly two a's OR exactly two b's }?
- How many states does the minimal complete DFA have for { w ∈ {a, b} : |w| is divisible by 3 and the second-last symbol of w is a }?
- How many states does the minimal complete DFA for { w ∈ {a, b} : w begins with a } have?