Home » Theory of Computation » Theory of computation miscellaneous » Question

Theory of computation miscellaneous

Theory of Computation

  1. Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s?
    1. (0+1)*0011(0+1)*+(0+1)*1100(0+1)*
    2. (0+1)*(00(0+1)*11+11(0+1)*00)(0+1)*
    3. (0+1)*00(0+1)*+(0+1)*11(0+1)*
    4. 00(0+1)*11+11(0+1)*00
Correct Option: B

Option (a) contains 00 and 11 consecutively which does not fulfill the required condition. Option (c) does not give assurance that both 00 and 11 will be exist in the string. According to option (d), string should start with 11 and ends with 00 or vice versa. Hence option (b) is the correct answer.



Your comments will be displayed only after manual approval.