GATE Computer ScienceHardGATE CS (PYQ pattern)
Taking Brzozowski quotients: let L = L(r) with r = a*(ba*b)* over {a, b}. A regular expression for the set of strings w such that bw ∈ L is
- A. a*b(ba*b)*
- B. a*(ba*b)*b
- C. a*b(a*b)*
- D. a*(ba*b)*
Correct answer: A. a*b(ba*b)*
The first b opens a block b a* b: the rest is a*b and then any further blocks, a*b(ba*b)*; the blocks cannot be interleaved with more a's between them.
More Theory of Computation questions
- Grammar G: S → ASB | ε; A → aAS | a; B → SbS | A | bb. After eliminating all ε-productions in the standard way (every way of deleting…
- Grammar G: S → AB | ASB | ε; A → a | aA | aAS; B → A | Sb | SbS | b | bS | bb. After eliminating the unit production(s) B → A (copy A's…
- In the grammar S → AB | aC | b; A → a | aE; B → bB | bD; C → c | cC; D → dD; E → e (start S), how many variables are useless (not…
- In the grammar S → AB | CD; A → aA | BC; B → b | CC; C → AC | c | ε; D → d | DA; E → eE | ε (start S), how many variables are nullable…
- A CNF grammar has productions S → AB | BC; A → BA | a; B → CC | b; C → AB | a. The CYK algorithm is run on the string baaba, filling a…
- For the CNF grammar S → AB | BC; A → BA | a; B → CC | b; C → AB | a, the CYK table for the string aabab has a top cell (the whole string)…