GATE / CS ARCHIVE

GATE CSE 2003 / QUESTION 14

Equivalent binary regular expressions

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

GATE 2003, Q14 1 mark · MCQ
Report issue

Regular Expressions & Languages

Question 14, GATE 2003: Which regular expression denotes the same language as 0*(10*)*? Here + means union. A. (1*0)*1*; B. 0+(0+10)*; C. (0+1)*10(0+1)*; D. None of these.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. For instance, 0010010 splits as 00·100·10 under the given expression. In A it splits into zero-terminated blocks with a final run of ones. B cannot produce the single string 1, and C requires a substring 10 and thus misses ε,0,1. This distinguishes the alternatives without merely appealing to a pattern resemblance.

2. Every binary string can be divided into an initial zero run followed by successive 1-and-zero-run blocks, so 0*(10*)*=Σ*. Likewise(1*0)*1* parses successive zero-terminated blocks followed by a final one run and also gives Σ*. Thus A. The other listed expressions do not cover exactly all binary strings.

Original paper, page 2