GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Exactly one of the following strings is NOT in the language of (a + ab)*(b + ba)*. Which one?
- A. abba
- B. aabba
- C. babab
- D. abbaa
Correct answer: D. abbaa
The second part (b + ba)* never contains aa, so the final aa of abbaa must lie in the first part (a + ab)*, which would then have to contain the whole string — impossible, because bb never occurs there. The others split: abba = ab | ba, aabba = a·ab | ba, babab = ε | ba·ba·b.
More Theory of Computation questions
- The regular expression a(bab)a is over Σ = {a, b}. How many states does the minimal complete DFA for its language have?
- The regular expression (a + b)(ab + ba)(a + b) is over Σ = {a, b}. How many states does the minimal complete DFA for its language have?
- Exactly one of the following strings is NOT in the language of (a + bb)(b + aa). Which one?
- The regular expression (a(ab)b) is over Σ = {a, b}. How many states does the minimal complete DFA for its language have?
- For the regular language L(r) with r = (aab + abb), the pumping lemma asks for a length p such that every w ∈ L with |w| ≥ p can be split…
- For the regular language L(r) with r = aaaa + ab, the pumping lemma asks for a length p such that every w ∈ L with |w| ≥ p can be split w…