GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Consider these claims about regular expressions over {a, b} (each equation compares the two languages): I. (a + b)*b = (a*b)⁺ II. (ab)*(a + ε) = (a + ε)(ba)* III. a*(ba*)* = (a + b)* IV. (a + ba)*b* = (a + b)* Which of the claims are correct?
- A. I, III and IV only
- B. I and III only
- C. I and IV only
- D. I, II and III only
Correct answer: B. I and III only
I is true. II is false. III is true. IV is false. Each was checked by comparing both languages on every string up to length 10 and by a structural argument.
More Theory of Computation questions
- 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?
- For the grammar E → E + E | E E | a (no precedence or associativity rules), the string a+aa+aa has 14 parse trees. In how many of them is…