GATE / CS ARCHIVE

GATE CSE 2008 / QUESTION 53

Regularity of four language families

Theory of Computation · Regular Expressions & Languages · Full GATE CSE 2008 paper

GATE 2008, Q53 2 marks · MCQ
Report issue

Regular Expressions & Languages

Question 53, GATE 2008: Which sets are regular? I: {a^n b^(2m) | n,m≥0}. II: {a^n b^m | n=2m}. III: {a^n b^m | n≠m}. IV: {xcy | x,y∈{a,b}*}.

(A) I and IV only
(B) I and III only
(C) I only
(D) IV only
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. I and IV are regular, giving A. I has expression a*(bb)*: n and m are independent and only the parity of the b-count is restricted.
2. IV has expression (a|b)*c(a|b)* because x and y need not be equal. II is {a2mbm}; applying the pumping lemma to a2pbp pumps only a symbols and destroys the required 2:1 relation.
3. III is not regular: if it were, subtracting it from the regular language a*b* would make {an bn} regular by closure under difference, a contradiction.

Original paper, page 10