GATE Computer ScienceHardGATE CSE
An NFA with ε-moves over {a, b} has states 0–4, start 0 and accepting state 4. Transitions: 0 –ε→ 1, 2 –ε→ 3; δ(0,a) = {0}; δ(1,b) = {2}; δ(2,a) = {1, 3}; δ(3,b) = {4}; δ(4,a) = δ(4,b) = {4}; all other moves are empty. Using ε-closures, how many distinct states (subsets, counting the empty set if reached) does the reachable part of the subset-construction DFA have?
- A. 7
- B. 6
- C. 8
- D. 10
Correct answer: A. 7
Start with ε-closure {0,1} and expand transitions on a and b, taking ε-closures each time; the reachable subsets number 7.
More Theory of Computation questions
- The grammar S → SS | a | b is ambiguous. How many distinct parse trees does it give for the string ababa?
- How many strings of length 8 does the grammar S → aSb | bSa | SS | ε generate?
- Consider these statements. I. Deterministic context-free languages are closed under complementation. II. Deterministic context-free…
- For a Turing machine M given as input, how many of these properties are undecidable? (a) L(M) = ∅ (b) M has at least 5 states (c) L(M)…
- Which of the following languages over {0, 1} is regular?
- A single-tape TM (blank B) starts in q0 at the leftmost symbol of a binary string. Rules: δ(q0,0) = (q0,0,R); δ(q0,1) = (q0,1,R); δ(q0,B)…