GATE / CS ARCHIVE

GATE CSE 1996 / QUESTION 1.8

Equivalent unary regular expressions

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

GATE 1996, Q1.8 1 mark · MCQ
Report issue

Regular Expressions & Languages

Question 1.8, GATE 1996: Compare (i)(00)*(ε+0), (ii)(00)*, (iii)0*, and (iv)0(00)*. Which expressions are equivalent?
Tap to enlarge
Your answer
Answer & solution

Answer: C: (i) and (iii) (no official key was published)

Expression (00)* produces every even number of zeros, including zero. Appending either ε or one zero therefore produces every nonnegative length, exactly 0*. Expression (ii) alone excludes odd lengths; expression (iv) produces only odd lengths and excludes ε. Thus only (i) and (iii) describe the same language. Checking both ε and a one-symbol word already distinguishes the parity-restricted alternatives from the full unary language.

Original paper, page 2