GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 1.4

Regularity of two unary-block languages

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

GATE 2001, Q1.4 1 mark · MCQ
Report issue

Regular Expressions & Languages

Question 1.4, GATE 2001: Assess regularity of L1={0^(2n):n≥1} and L2={0^m1^n0^(m+n):m,n≥1}. Choices A/B/C/D assert only L1, only L2, both, or neither is regular.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step 1: S1 contains positive even-length strings of zeros, described by regular expression 00(00)*, so it is regular.

Step 2: Suppose S2 were regular with pumping length p. Choose 0p1p02p. Any pumping segment in the first p symbols consists of k≥1 initial zeros. Pumping it out changes the first zero-block length to p−k while leaving the final zero block length 2p. That final block no longer equals the sum(p−k)+p. This contradicts the pumping lemma.

Therefore S2 is not regular and only S1 is correct, A.

Original paper, page 1