Skip to content
Official PYQ · 2009

GATE CS 2009 Q15 — Regular Expressions and Finite Automata

Explain with AI

Which one of the following languages over the alphabet {0,1}\{0,1\} is described by the regular expression: (0+1)∗0(0+1)∗0(0+1)∗(0+1)^*0(0+1)^*0(0+1)^*?

Choose one option
View worked solution

Answer: C

To determine the language described by the regular expression R=(0+1)∗0(0+1)∗0(0+1)∗R = (0+1)^*0(0+1)^*0(0+1)^*, let us analyze its structure:

  • The term (0+1)∗(0+1)^* represents any arbitrary string (including the empty string ϵ\epsilon) over the alphabet {0,1}\{0, 1\}.
  • The expression contains two explicit 00's separated and surrounded by (0+1)∗(0+1)^*.

This structure guarantees that any string matching this regular expression must contain at least two 00's. There are no restrictions on the characters appearing before the first 00, between the two 00's, or after the second 00.

Thus, the language represents the set of all strings containing at least two 00's.


Elimination of Other Options:

  • Option A: The string 010010 is generated by the regular expression, but it does not contain the substring 0000. Thus, Option A is incorrect.
  • Option B: The string 000000 contains three 00's and is generated by the regular expression. This contradicts "at most two 00's". Thus, Option B is incorrect.
  • Option D: The string 00 begins and ends with 00, but it cannot be generated by the regular expression (as it has only one 00). Thus, Option D is incorrect.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular Expressions and Finite Automata questions