Let r1=(0+1)*, r2=0*1+10*+0*+1*. What is the length of the smallest string that is present in language corresponds to regular expression r1 and not present in language corresponds to regular expression r2.
Answer key has given the answer as a. 2
Given,
r1 = (0+1)* = set of all strings of 0 or 1
r2 = 0*1+10*+0*+1*
= { ɛ, 0, 1, 00, 01, 10, 11, 000, 001, 100, 111, ….}
Since, 010, 011, 101, 110 is present in r1 but not in r2 and length is 3
so ans is b.
Try generating 11 with R2.
In r2, there is 1* so it generates 11.
;)
64.3k questions
77.9k answers
244k comments
80.0k users