GATE CS 2016, set 1 · Question 28 · Theory of Computation · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0 s and two consecutive 1 s ?

  1. (A) (0+1)^*0011(0+1)^* + (0+1)^*1100(0+1)^*
  2. (B) (0+1)^*(00(0+1)^*11 + 11(0+1)^*00)(0+1)^*
  3. (C) (0+1)^*00(0+1)^* + (0+1)^*11(0+1)^*
  4. (D) 00(0+1)^*11 + 11(0+1)^*00
Answer

Answer (B)

Answer from the official GATE CS 2016 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes