GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Consider these claims about regular expressions over {a, b} (each equation compares the two languages): I. (ba)*b = b(ab)* II. (a + b)*a*b* = (a + b)* III. (a + ba)*b* = (a + b)* IV. (a + b)*a = (a + b)*(a + ba) Which of the claims are correct?
- A. IV only
- B. II and IV only
- C. I, II and IV only
- D. I, II and III only
Correct answer: C. I, II and IV only
I is true. II is true. III is false. IV is true. Each was checked by comparing both languages on every string up to length 10 and by a structural argument.
More Theory of Computation questions
- Consider these claims about regular expressions over {a, b} (each equation compares the two languages): I. (a + b)b = (ab)⁺ II. (ab)(a +…
- Which one of the following context-free grammars (start symbol S, terminals a, b) is unambiguous?
- Which one of the following context-free grammars (start symbol S, terminals a, b) is ambiguous?
- For the grammar S → SS | SSS | a, how many distinct parse trees does the string aaaaa (five a's) have?
- For the grammar S → aS | Sb | aSb | c, how many distinct parse trees does the string aacbb have?
- For the grammar S → SaS | SS | b, how many distinct parse trees does the string bbabb have?