CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following regular expressions over {0, 1} respectively.
I. 101 (0 + 1)* 101
II. 101 (0 +1) * 101 + (10)21
III. 101 (0 + 1)*

Which of the above regular expression(s) correctly generate the set of all binary strings starting and ending with 101?

A
None of these
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
I only
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
III only
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
II only
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A None of these
None of these regular expressions generate the required language. For example,the regular expressions I and II do not generate the string 101, which also starts and ends with 101. However the third regular expression actually generates a superset of the required language and thus some non members which do not end with 101 are also generated. Hence option D is the most appropriate choice. And it's good to know that the correct regular expression for the specification given will be 101 (0 + 1)* 101 + 101 + 10101

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Pythogoras Theorem
Watch in App
Join BYJU'S Learning Program
CrossIcon