GATE Computer ScienceHardGATE CSE · UGC NET
Let L = { w ∈ {a,b}* : the 4th symbol from the right end of w is 'a' }. The minimal DFA for L has how many states (including any dead/trap state)?
- A. 8
- B. 16
- C. 15
- D. 32
Correct answer: B. 16
The DFA must remember the last 4 symbols; all 2^4 = 16 histories are pairwise distinguishable (verified by Myhill–Nerode enumeration), and no dead state exists.
More Compiler Design questions
- Procedure P(x, y) { x = x + 1; y = x + y; } is called as P(a, a) with a = 3. What is a after the call under call-by-reference, and under…
- Grammar: S → L = R | R; L → R | id; R → L (augmented with S' → S). How many states do the LR(0) automaton and the canonical LR(1)…
- Grammar: S → a A d | b B d | a B e | b A e; A → c; B → c. How many states does the canonical LR(1) collection contain, how many does…
- For the standard expression grammar E → E + T | T; T → T F | F; F → ( E ) | id (augmented), how many states does the canonical LR(1)…
- For S → C C; C → c C | d (augmented), the canonical LR(1) collection has some states that share an LR(0) core. By how many states does…
- Grammar: S → A a | b A c | d c | b d a; A → d. How many conflicting (state, terminal) entries are there in its SLR(1) table, and how many…