GATE Computer ScienceVery hardGATE CSE · UGC NET
A DFA over {0,1} has states p0 (start), p1, p2, A (accepting), D. Transitions: p0 –0,1→ p1; p1 –0,1→ p2; p2 –1→ A; p2 –0→ D; A –0,1→ A; D –0,1→ D. It therefore accepts the strings whose third symbol is 1. Reverse every transition, make A the start state and p0 the only accepting state, and determinise the result. How many states does the minimal complete DFA for the reversed language have?
- A. 5
- B. 16
- C. 6
- D. 8
Correct answer: D. 8
The reversed language is "the third symbol from the right is 1"; the DFA must remember the last 3 symbols (short strings behave like zero-padded ones), so the minimal DFA has 2³ = 8 states, although the original DFA had only 5.
More Theory of Computation questions
- How many strings of length 12 over {a, b} contain neither aba nor bbb as a substring?
- Consider the grammar S → aSbS | bS | ε over {a, b}. How many strings of length exactly 9 does it generate?
- The grammar S → SS | aS | a is used to parse the string a⁶ (six a's). How many different parse trees does a⁶ have?
- A Turing machine (blank B, halts when no rule applies or in state acc) has rules: q0: a→(q1,B,R), b→(q2,B,R), B→(acc,B,S); q1 and q2…
- Which regular expression (+ denotes union) denotes exactly the set of non-empty strings over {a, b} that start with a, end with a and…
- How many strings of length 10 over {a, b} belong to the language of (a+b)(aab + bba)(a+b), that is, contain aab or bba as a substring?