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

The length of the shortest string NOT in the language (over={a,b}) of the following regular expression is

ab(ba)a
  1. 3

Open in App
Solution

The correct option is A 3
Check the string one-by-one starting from ϵ, a, b, aa, ab, ba, bb,... until we reach the first string that is not generated by the given regular expression ab(ba)a.

In this case smallest string NOT generated by the given regular expression is 'bab' whose length is 3.

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