Which of the following statements is TRUE about the regular expression 01*0?

2005

Which of the following statements is TRUE about the regular expression 01*0?

  1. A.

    It represents a finite set of finite strings.

  2. B.

    It represents an infinite set of finite strings.

  3. C.

    It represents a finite set of infinite strings.

  4. D.

    It represents an infinite set of infinite strings

Attempted by 117 students.

Show answer & explanation

Correct answer: B

The regular expression 01*0 matches strings that start with '0', followed by zero or more '1's, and end with '0'. This generates strings like '00', '010', '0110', etc. The number of such strings is infinite because the middle part can have any number of '1's, but each individual string is finite in length. Therefore, it represents an infinite set of finite strings, making option B correct.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir