GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 2.6

Regularity of copying, reversal and unary lengths

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

GATE 2001, Q2.6 2 marks · MCQ
Report issue

Regular Expressions & Languages

Question 2.6, GATE 2001: Which languages are regular? L1={ww:w∈{a,b}*}; L2={ww^R:w∈{a,b}*}; L3={0^(2i)}; L4={0^(i²)}, interpreting valid nonnegative lengths. Choices: L1/L2; L2/L3/L4; L3/L4; only L3.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step 1: L3 contains even-length unary strings, recognized by a two-state parity machine. Interpreting only nonnegative string lengths, negative integer parameters do not add new words.

Step 2: L1={ww} is nonregular: prefixes an b are pairwise distinguishable, since suffix an b makes a square with that prefix but not with am b for m≠n. L2={wwR} is nonregular: prefixes an b are distinguished by suffix b an; the resulting word am bb an is an even palindrome exactly when m=n.

Step 3: L4 has square unary lengths. For pumping length p, pump a nonempty segment of length k≤p in 0p². Pumping once more gives length p²+k strictly between consecutive squares p² and(p+1)², contradiction.

Therefore only L3 is regular, D.

Original paper, page 4