GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 1.12

Testing a word against four regexes

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

GATE 1998, Q1.12 1 mark · MCQ
Report issue

Regular Expressions & Languages

Question 1.12, GATE 1998: Which does not contain 1101: A 110*(0+1), B1(0+1)*101, C(10)*(01)*(00+11)*, D(00+(11)*0)*?
Tap to enlarge
Your answer
Answer & solution

Answer: C, D (no official key was published)

A accepts 1101 using one zero in 0* and final 1. B accepts it with an empty middle star:1·101. For C, the initial 10 block cannot be used because the word starts 11; neither can the next 01 block. The remaining (00+11)* cannot partition 1101 into equal-symbol pairs because its last pair is 01. Thus C rejects. Every nonempty block of D ends in 0, so every nonempty word of D ends in 0;1101 ends in 1 and is rejected too. The paper shows these expressions. A single-answer instruction therefore conflicts with the two rejecting choices.

Original paper, page 2