Give a regular expression for the set of binary strings in which every 0 is…

GATE · Computer Science · 1998

Give a regular expression for the set of binary strings in which every 0 is immediately followed by exactly k 1s and preceded by at least k 1s, where k is a fixed positive integer.

  1. A.

    1∗1k(01k)∗ + 1+

  2. B.

    1∗1k(01k)∗ + 1∗

  3. C.

    1+1k(01k)∗ + 1+

  4. D.

    1k(01k)∗ + 1∗

Attempted by 38 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…